WhoBuilt

What issues can React Navigation 5 solve?

Apr 9, 2021· 9 min· 192 views·Watch on YouTube

Speaker

Sadia of Callstack explains how React Navigation 5 addresses limitations in the earlier API and what new navigation features it adds.

Why the static API was limiting

The host says the static API made it difficult to control a header from inside a component. Sadia says it also limited themes and dynamic translations, and that changing the library’s underlying architecture required a rewrite.

A component-based dynamic API

React Navigation 5 replaces top-level object configuration with rendered components. This lets developers use React state to choose screens, build tabs from server-fetched data, update headers, translate content through context, and apply themes.

Simpler options and theming

Sadia describes `setOptions` for updating titles, headers, and other navigator options. The new theming API lets developers define colors such as brand colors for navigation UI, without replacing each component.

Animations, links, and events

The stack navigator was rewritten with React Native Gesture Handler, enabling per-screen animation choices and a new iOS modal presentation. Sadia also mentions drawer navigation using Animated and Gesture Handler, a more customizable deep linking API with support for a 404 screen, hook-based APIs, and a simpler event listener system.

From Rebel Navigation to React Navigation

The host recalls prototyping a component-based approach in Rebel Navigation. Sadia says that work helped shape ideas for the API, which was later implemented in React Navigation Stack and released as part of version 5.

Takeaways

  • Use a component-based navigation configuration when screens or navigation options need to respond to app state.
  • Use `setOptions` to update screen titles and headers from within the app.
  • Define navigation colors centrally with the theming API instead of replacing each UI component.
  • Choose transitions per screen and use the deep linking API to handle unmatched URLs.
  • Use hooks and event listeners for navigation logic in function components.

Mentioned in this talk

Search inside this talk

What was claimed 9

Show all 9 facts

Related talks