WhoBuilt

Practicalities of React Navigation 5

Apr 9, 2021· 7 min· 141 views·Watch on YouTube

Speaker

Mateusz, a React Navigation 5 upgrader at an unnamed client, discusses migration lessons with the Callstack podcast host and Satya; he also credits Adam Zinski from Kosak for substantial upgrade work.

Simpler focus and blur events

Mateusz says React Navigation 5 reduces the navigation events developers need to track to focus and blur. The `useFocus` hook handles setting up and clearing listeners, making focus-aware components easier to manage.

Persistence and migration effort

Experimental state persistence in v5 preserves navigation state across refreshes, so developers can return to the screen they were working on. Mateusz cautions that migration estimates should account for more than simple package-name replacements: consuming screen state through route objects and hooks can require component changes, depending on the codebase.

Accessibility needs attention

Mateusz reports unusual TalkBack behavior on Android and says his team is working with the React Navigation team to investigate. He urges teams to check accessibility as part of their apps.

Use the upgrade to simplify navigation

Mateusz says setting elements such as headers dynamically in React hooks creates new options for apps. His team used the component-based API during the upgrade to simplify navigation on both iOS and Android, replacing separate platform setups with one that was easier for teammates to understand. He credits Adam Zinski from Kosak for substantial work.

Takeaways

  • Estimate migrations against actual component changes, not just package renames.
  • State persistence can save time by restoring the screen being edited after a refresh.
  • Use focus-aware hooks to avoid managing navigation listeners by hand.
  • Check TalkBack behavior on Android and investigate accessibility issues with the navigation team.
  • A major API migration can also be a chance to simplify platform-specific navigation setup.

Mentioned in this talk

Search inside this talk

What was claimed 7

Related talks