Rangle.io: React Native Workshop
gitbook
gitbook
  • Introduction
  • Setup
    • Hello World
    • Debugging
  • Core Concepts
    • Components
    • Styles
    • Flexbox
    • APIs
  • Navigation
    • Navigation Experimental
    • Creating Some Helpers
    • The Navigator Component
  • ListView (Pokédex)
    • List View
    • List View: Render Row
    • Text Input
    • Keyboard Spacer
  • Selectors (Filtering)
  • Animation
    • LayoutAnimation
    • Animated
      • Animated.Value
      • Timing, Spring & Decay
      • Animated Components
      • More Animated
    • Resources
    • Exercise
  • ScrollView (Pokemon Details)
  • MapView
  • Testing
  • Gesture Responder System
    • PanResponder
Powered by GitBook
On this page
  • Debug in Chrome
  • YellowBox
  • RedBox

Was this helpful?

  1. Setup

Debugging

PreviousHello WorldNextCore Concepts

Last updated 6 years ago

Was this helpful?

React Native provides several tools to make debugging easier. To access the in-app developer menu:

  • Press ⌘ + d in the iOS simulator

  • ⌘ + m or F2 in the Android emulator

  • Alternatively use the shake gesture:

    • control + ⌘ + z in the iOS simulator

    • Clicking 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
debug menu
yellow box warning
red box warning