WhoBuilt

Component based Navigation in React Native

Feb 18, 2020· 27 min· 699 views·Watch on YouTube

Speaker

Satyajit Sahoo, a front-end developer at Callstack, explains component-based navigation in React Native at React Native Wrocław Meetup #1.

Why native navigation needs its own patterns

Sahoo contrasts browser navigation, where a URL determines the screen, with native apps, which need smooth transitions and familiar platform patterns. He describes how headers, gestures, and animations vary between iOS and Android, including across Android versions, making navigation complex to implement consistently.

How React Native navigation evolved

Sahoo reviews earlier options, from iOS-only NavigatorIOS to JavaScript-based Navigator and the low-level NavigationExperimental. He also discusses native React Native Navigation and Expo’s ExNavigation, noting trade-offs such as platform support, animation performance, customization, and React-style composition. React Navigation brought contributors from Facebook, Expo, Callstack, and the wider community together around a simpler, customizable API.

Navigators manage screens, state, and transitions

A navigator manages both transitions and navigation state, including the current screen and back history. React Navigation combines core logic and routers with UI patterns such as stacks, tabs, and drawers. Sahoo describes a stack as cards pushed onto and removed from a pile, alongside platform-specific tab and drawer patterns.

A dynamic, typed API adds flexibility

The earlier API used static configuration, which limited access to props, state, and context and made screen options difficult to change dynamically. The rewritten API defines screens as children during render, enabling conditional routes such as showing Feed and Account when logged in and Login or Signup otherwise. Sahoo also covers dynamic options, hooks, TypeScript editor support, native stack and tab integrations, and Redux DevTools time travel.

Takeaways

  • Choose navigation patterns that match native platform expectations, including transitions and gestures.
  • Treat navigation state and transition UI as connected responsibilities of a navigator.
  • Define screens during render when route availability depends on props, state, or context.
  • Use native navigation primitives when platform performance matters more than extensive customization.
  • Use navigation state debugging tools to inspect actions and revisit earlier states.

Mentioned in this talk

Search inside this talk

What was claimed 7

Related talks