
Auth Navigator (Stack)
As highlighted in the diagram, adding a new screen or stack to the Auth Navigator is useful for authentication-related features. Common use cases include:- Additional authentication methods (social logins, biometric auth, etc.)
- Multi-step registration flows
- Password reset/recovery flows
- Pre-authentication onboarding screens
- Post-authentication setup screens
- Account verification flows
navigate
function:
Home Navigator (Drawer)
The Home Navigator uses drawer navigation, which is ideal for organizing and categorizing screens into logical groups. Adding a new screen to the Home Navigator is useful for adding new features that are accessible from the main drawer. Common use cases include:- Access to features within the app that require an authenticated user (e.g. profile, settings, dashboard)
- Additional account management screens (e.g. account details, preferences, billing)
- Additional help and support screens (e.g. FAQs, contact support, documentation)
- Analytics and reporting screens
- Feature-specific screens that don’t require their own navigator
Adding a Screen to Home Navigator (Drawer)
Here’s a simple example of how to add a new screen to the drawer navigation:- Create your new screen component:
- Add the screen to your drawer navigator:
- Add the screen to your drawer menu by updating the drawerOptions array in CustomDrawerContent:
drawerOptions
array controls what appears in your drawer menu. Each object in the array needs:
icon
: The icon to display (using react-native-vector-icons)title
: The text to show in the menuscreen
: The screen name to navigate to (must match a Drawer.Screen name)