Search code examples
react-nativewarnings

React Native yellow warning on the Terminal


every time I run my react project, I have hundreds of yellow warning coming on my Terminal. impossible to see any console.log()

I know, I am fixing them however it is talking time and I need to see a clean terminal when I am working on other thing.

I do no have a yellowwood on my simulated device as I disabled it using console.disableYellowBox = true;

I tried

YellowBox.ignoreWarnings(['Warning: ReactNative.createElement'])
console.ignoredYellowBox = ['Warning: ReactNative.createElement'];

``` in my index.js without success


I am using 
react": "16.9.0",
   "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz",

Solution

  • Have you tried debugging your app through Google chrome?

    You can do so by opening the dev menu by shaking your device or if you are using a simulator by pressing cmd+d or ctrl+cmd+z on iOS and double press m on Android and then select the Debug JS option.

    This will open a tab in your browser pointing to http://localhost:8081/debugger-ui/

    What this basically does is redirect all the JS files to run in your browser engine directly, that way you can add breakpoints in your code by using the word debugger and they will show up in your browser just as they would when developing for the web.

    You can also use the console tab of your browser to visualize console.* messages and objects that might be hard to check when using only the terminal

    There is one side note though, you shouldn't always rely on remote debugging as the chrome JS engine is used during debugging and it has some slight differences from the JavaScriptCore used otherwise. These differences are mainly related to the Date() object but you can read more about that here