Tab and drawer navigation
So far in this chapter, each example has used Button
components to link to other screens in the app. You can use functions from react-navigation
that will create tab or drawer navigation for you automatically based on the screen components that you give it.
Let's create an example that uses bottom tab navigation on iOS and drawer navigation on Android.
Important Note
You aren't limited to using tab navigation on iOS or drawer navigation on Android. I'm just picking these two to demonstrate how to use different modes of navigation based on the platform. You can use the exact same navigation mode on both platforms if you prefer.
For this example, we need to install a few other packages for tab and drawer navigators:
npm install @react-navigation/bottom-tabs @react-navigation/drawer
Also, the drawer navigator requires some native modules. Let's install them:
expo install react-native-gesture-handler react-native-reanimated...