Pitch & anti-pitch
Choosing a navigation library means choosing its tradeoffs. This page summarizes the problems React Navigation is designed to solve, as well as cases where it may not be the right fit. Please submit a pull request if you believe we have omitted something important.
Pitch
- Explicit navigation graph - Routes, nesting, groups, and navigator options are declared in code, making the navigation structure directly inspectable and independent of the filesystem.
- Simple setup with flexible configuration - Static configuration provides automatic TypeScript type inference from the navigator configuration and can generate paths for deep linking. It can also conditionally include screens and groups based on application state. For navigation structures defined at runtime, you can use dynamic configuration or combine both approaches.
- State-based navigation with advanced control - The state model supports nested histories and high-level operations such as reset, persistence, and preload, while actions and custom routers provide deeper control when needed.
- URLs independent of UI structure - Navigator nesting can change without changing public URLs, allowing the navigation UI to evolve without breaking existing links.
- Flexible linking - The linking configuration supports custom path patterns, parameter parsing, regular expressions, catch-all routes, and fully custom conversion between paths and navigation state.
- Choice of native or JavaScript implementations - Native Stack and Native Bottom Tabs use platform navigation primitives. JavaScript implementations provide more control over UI, animations, and gestures, and are easier to debug, customize, and update over the air.
- Extensible building blocks - Custom navigators and custom routers integrate with the same navigation actions, deep linking, state persistence, and nesting used by built-in navigators.
- React Native and Web - The same navigation model works across React Native and Web. On Web, React Navigation integrates with URLs, browser history, links, and accessibility features.