Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for colors in ReactNative #728

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrobber
Copy link

@jrobber jrobber commented Nov 1, 2019

ReactNative renders in a document-less mode, but goes through the browser for their live builds.
Fortunately they tag the navigator as ReactNative making this easy to check for.

ReactNative renders in a document-less mode, but goes through the browser for their live builds.
Fortunately they tag the navigator as ReactNative making this easy to check for.
@jrobber jrobber changed the title Adding support for ReactNative Adding support for colors in ReactNative Nov 1, 2019
@coveralls
Copy link

Coverage Status

Coverage remained the same at 87.692% when pulling 18cfc3c on jrobber:master into 5c7c61d on visionmedia:master.

@jrobber
Copy link
Author

jrobber commented Nov 1, 2019

With this change you can set the environment variables before you import debug anywhere (like in index.js or in a config.js) like so :

process.env.DEBUG = ['*'].join(','); //init,search,addListing:price,reservation:*
process.env.DEBUG_COLORS = true;

You could tie those to variables in the manifest if you want to, but the main value of this in ReactNative is development debugging, not distributed.

This will only allow the logs to be colored in the browser terminal. React-native/expo need to make changes that convert browser colors to server colors if debug is going to work in their terminals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants