There are many different ways to do your debugging in React Native applications. Since React Native has both IOS and Android environments, there’s a wide range of different problems you can encounter and a wide range of different tools needed. We’re going to explore a few different ways to debug. Let’s start with outlining the dev menu:
Developer menu
The developer menu includes some different ways to debug and access debugging tools.
- Reload: reloads the app
- Debug JS Remotely: opens to a JavaScript debugger
- Enable Live Reload: causes the app to reload automatically after selecting “Save”
- Enable Hot Reloading: watches for changes
- Toggle Inspector: toggles the inspector interface so we can inspect UI elements and their properties
- Show Perf Monitor: monitors performance
Chrome DevTools
You can use these DevTools to debug React Native apps. You need to make sure that it’s connected to the same WiFi. If you’re using Windows or Linux, press Ctrl + M+, and if you’re using macOS, press Command + R. In the developer menu, you select “Debug JS Remotely” and it will open the default debugger.
React Developer Tools
To use React’s Developer Tools, you have to use the desktop app. These tools allow you to debug React components and styles.
React Native Debugger
If you’re using Redux in your React app, this is a good debugger for you. It’s a desktop app that integrates Redux’s and React’s developer tools in one app.
React Native CLI
You can use the React Native command-line interface to do debugging as well.