Navigators, scenes, routes, and stacks
The core mechanism you'll use to control navigation in your React Native app is the Navigator
component. It's used to control route stacks and scenes. I'll quickly define these concepts here, and then we'll dive into some code.
- Navigator: The overarching component that's used to control how users navigate through your application
- Scene: A simple React component that represents what the user is currently looking at. Instead of pressing a link on a page that takes them to another page, the
Navigator
takes them to another scene - Route: A JavaScript object containing information about a scene. The
Navigator
figures out how to render a scene based on information provided by a route - Stack: A stack of routes held by the
Navigator
. These are all the routes that the user can navigate to in a React Native application
Confused? Don't worry! This will all start to make sense once I start speaking in code: right now.
Note
There are actually...