WhoBuilt

What went wrong?! Deep dive into debugging RN applications

Oct 19, 2021· 15 min· 1.4K views·Watch on YouTube

Speaker

Monica Restrepo, a software engineer at Equinox Media, compares React Native debugging tools at React Native EU 2021.

Three common sources of bugs

Restrepo groups mobile app bugs into app-specific, platform-specific, and architecture-related issues. Examples include broken buttons and network problems, differences between iOS and Android behavior, and incorrect data flow that affects unrelated features.

What Flipper offers

Flipper is a separate desktop app that supports React Native, iOS, and Android debugging. Its plugins can inspect layouts and accessibility properties, shared preferences, network requests, device logs, and crashes. Restrepo says its network tools are clear and capable, while noting that its iPhone version lacked breakpoints and its JavaScript debugger could not connect to Reanimated's JavaScript context.

React Native Debugger and breakpoints

React Native Debugger covers features such as layout inspection, logs, and network requests, and its Sources tab lets developers set breakpoints, inspect scope, and follow call stacks. Restrepo found it useful for Apollo and GraphQL caching, but says network inspection is less intuitive than Flipper's and debug mode can slow an app. Charles can help when deeper network analysis is needed.

Reactotron's additional tools

Reactotron requires a desktop app and project setup, and supports more than React Native, including macOS, Windows, and Linux apps. It can inspect requests and state, dispatch actions through its GUI, track global errors and asynchronous storage, and run quick performance benchmarks. Restrepo notes it has fewer features than Flipper and does not support breakpoints.

Choose tools for the workflow

Restrepo says all three tools can handle many of the same debugging tasks, but she plans to keep at least two available. She may switch from React Native Debugger when it slows the app or use Flipper when its interface suits the task better. Flipper and Reactotron both require setup in the app.

Takeaways

  • Classify a bug as app-specific, platform-specific, or architecture-related to narrow the investigation.
  • Use Flipper's layout and accessibility inspection to investigate UI and styling issues.
  • Use breakpoints and call stacks in React Native Debugger to trace data and component property flows.
  • For deeper network analysis, consider Charles when the debugger's built-in network view is insufficient.
  • Keep more than one debugger available so you can switch when performance or workflow needs change.

Mentioned in this talk

Search inside this talk

What was claimed 10

Related talks