Flow library definitions for React Navigation 5 are now available on flow-typed! With this rewrite we’re now able to typecheck much more of the surface area of React Navigation. Libdefs are available for the following packages:

  • @react-navigation/core
  • @react-navigation/native
  • @react-navigation/stack
  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-bottom-tabs
  • @react-navigation/material-top-tabs

ParamList

To properly type the navigate function on the navigation prop, we need to pass in the full list of route names, as well as their corresponding params. We call this map a ParamList. Here’s an example of one:

Since the…

Ashoat Tevosyan

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store