WhoBuilt

Contributing To React Native Is Easy

Oct 22, 2020· 26 min· 613 views·Watch on YouTube

Speaker

Fabrizio Bertoglio, a React Native developer, explains how developers can diagnose platform issues and contribute fixes, speaking at React Native EU 2020 with Callstack.

Where app development gets difficult

Building his Surf Check app over about a year exposed problems with unstable development environments, native dependency setup, and upgrades from React Native 0.59 to 0.62. He also describes unexpected behavior in FlatList callbacks and text indexes, plus performance trouble displaying many custom map pins. Pinch to zoom for video was difficult to build in 2019, but became easier after a React Native Camera pull request was merged in 2020.

Common sources of confusion

Bertoglio groups community issues around style behavior, text input indexes, bridge performance, and third-party library limits. React Native styles do not behave exactly like CSS, partly because Android APIs differ; for example, a touch handler may fail inside an absolutely positioned parent with no dimensions. Fast text input can also be slowed by change events reaching limits in the React Native bridge.

A practical debugging workflow

He recommends building React Native from source, adding it to an example app, and creating a minimal reproduction of the bug. Then use JavaScript tools such as Flipper or console logging, and Android Studio breakpoints when the issue is in native Java code. Logging both JavaScript and Java can help trace how the two sides interact.

Start with a smaller native library

Bertoglio suggests contributing to a smaller native library, such as React Native Camera, before tackling React Native itself. That work helped him understand the bridge between JavaScript and native APIs and learn Android and iOS source code. He demonstrates debugging barcode scanning by checking image dimensions and crop coordinates, then showing how a 915-by-600-pixel crop is decoded.

Small fixes can resolve visible bugs

Examples include correcting keyboard-avoidance sizing when a translucent status bar affects the visible area, and using numeric font weights on Android API 28 and later. He also describes changing text input gravity to address scrolling problems and replacing a problematic default drawable in the app template. His closing workflow is to reproduce the bug, reduce it to a minimal example, find the relevant source, and investigate the Android or iPhone API involved.

Takeaways

  • Reproduce a bug with the smallest example that still triggers it.
  • Use JavaScript logs and native debugger breakpoints to trace behavior across the bridge.
  • Try contributing to a smaller native library to learn the React Native bridge and platform APIs.
  • Check platform API behavior before assuming a React Native feature should match CSS or web behavior.

Mentioned in this talk

Search inside this talk

What was claimed 6

Related talks