Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1.63 KB

7-Debugging.md

File metadata and controls

26 lines (16 loc) · 1.63 KB

Chapter 7 - Debugging

Console.log and warn

There is an argument that this fits the fast development philosophy of RN to develop fast and get immediate feedback so don't shy away from console.log and warn .. use them!

React Native Standalone debugger

React Native Debugger is a standalone electron app for debugging React Native apps. This uses the familiar Chrome DeV tools

To get the Debugger listening to the default Expo port, run this command open 'rndebugger://set-debugger-loc?host=localhost&port=19001'

Enable remote debugging

Use Chrome Dev Tools

  • Although source mapping is generally reliable, it still has issues with async/await, you might need to use the debugger keyword in your code to get the breakpoints to stop where you expect them.
  • Enabling Network inspection considerably slows the the debugger
  • Install Redux DevTools - if your app is using Redux, it's a great way to debug (and also reverse-engineer) code

RN Wisdom: Optimsations - Use the memory and CPU profilers of RN Debugger to identify bottlenecks and unexpected behaviour in your code. You'd be surprised about what you find!

Resources