Skip to content

How to understand a React Native codebase

React Native renders native views from React components. The JavaScript side looks like a React app with navigation instead of URLs; the `android/` and `ios/` folders hold native projects that are usually generated but sometimes customised.

How to tell it's React Native

  • react-native in package.json, index.js calling AppRegistry.registerComponent
  • android/ and ios/ folders and a metro.config.js
  • Components from react-native such as View, Text and FlatList

Where things usually live

index.js
Registers the root component.
App.tsx or src/App.tsx
Root component with providers and the navigator.
src/navigation/
Stack, tab and drawer navigators (often React Navigation).
src/screens/
Screen components.
src/native/ or modules/
Bridges to custom native code.
android/ and ios/
Native projects: permissions, build settings, native dependencies.

Conventions, not rules. Real projects rename and move things, so confirm against the repository.

Where to start reading

  1. App.tsx and the navigation setup, to list every screen
  2. Any custom native modules
  3. Native config files for permissions and deep links

How a request moves through the code

  1. 1The native app starts and loads the JavaScript bundle built by Metro.
  2. 2AppRegistry runs the root component.
  3. 3The navigator shows a screen; navigation passes params between screens.
  4. 4Screens fetch data and render native views through React Native components.
  5. 5Platform features go through native modules, from libraries or custom code.

Questions to ask about the repository

  • Map the navigation tree: every navigator and screen.
  • Which native modules does the app use, and which are custom?
  • How are deep links handled?

What trips people up

  • Files ending .ios.tsx and .android.tsx are platform-specific versions of the same module.
  • Native changes need a rebuild of the app; reloading JavaScript isn't enough.
  • The New Architecture changes how native modules are written, so check which one the app uses.