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
takes them to another sceneNavigator
figures out how to render a scene based on information provided by a routeNavigator
. These are all the routes that the user can navigate to in a React Native applicationConfused? Don't worry! This will all start to make sense once I start speaking in code: right now.
There are actually two other Navigator
components offered by React Native. I'm only covering the generic Navigator
component because it works the same on both iOS and Android. But if you're interested, there's NavigatorIOS
which is geared toward iOS devices, and NavigatorExperimental
, which takes a different approach to handling routing.