Debugging
React Native provides several tools to make debugging easier. To access the in-app developer menu:
Press
⌘ + din the iOS simulator⌘ + morF2in the Android emulatorAlternatively use the shake gesture:
control + ⌘ + zin the iOS simulatorClicking on the menu button in the Genymotion Android simulator
You can use this menu to enable/disable live reloading, hot reloading, component inspector, etc.

Debug in Chrome
This option allows you to debug your JavaScript code in Google Chrome. The code is executed in a Chrome tab you have access to all the usual devtools such as: debugger statements, break-points, console logging, etc.
YellowBox
Using console.warn will display an on-screen log on a yellow background. Click on this warning to show more information about it full screen and/or dismiss the warning. Place
console.disableYellowBox = true;in the root component to temporarily disable warnings

RedBox
You can use console.error to display a full screen error on a red background.

📚 More info on Yellow/Red Box available here: rn-docs/debugging.html#yellowbox-redbox
Last updated
Was this helpful?