Skip to main content

Adding New Screens to the Mobile App

This guide walks you through adding new screens to the Launch mobile app, including proper navigation setup, route registration, and navigation guards.

Overview

The Launch mobile app uses a nested navigation structure with NativeTabs inside an AppStack:

Prerequisites

  • Expo Router basics
  • App running locally

Steps

Step-by-Step Process

1. Create the Screen Component

Create your screen file in the app/ directory: File: apps/mobile/app/your-screen.tsx

2. Customize Screen Options (Optional)

Expo Router uses file-based routing, so your screen is registered automatically. If you want custom header options, add them to the layout: File: apps/mobile/app/_layout.tsx or apps/mobile/app/(tabs)/_layout.tsx

3. Adjust Redirect Rules (if needed)

If the screen should be reachable during onboarding or auth flows, update the redirect logic in apps/mobile/lib/hooks/useAppNavigation.ts.

4. Add Navigation from Other Screens

To navigate to your screen from within tabs (like Explore): From within a tab screen:
Using FeatureCard component:

From Tabs to AppStack Routes

When navigating from inside tabs to AppStack routes, you need to access the grandparent navigator:

Direct AppStack Navigation

For routes at the same level in AppStack:

Back Navigation

Back navigation works automatically with the configured headerBackTitle:
  • iOS: Shows ”< Features” or custom back title
  • Android: Shows standard back arrow
  • Gesture: Swipe from edge works automatically

Screen Types and Presentations

Fullscreen Presentation

Navigation guards live in apps/mobile/lib/hooks/useAppNavigation.ts and handle:
  • Redirecting unauthenticated users to auth
  • Redirecting users with incomplete onboarding
  • Sending fully onboarded users to the main tabs

Common Issues and Solutions

Issue: Navigation Not Working from Tabs

Problem: Calling navigation.navigate() from inside tabs doesn’t work. Solution: Use grandparent navigation:

Issue: Automatic Redirect Away from Screen

Problem: User gets redirected back to onboarding or tabs. Solution: Update redirect logic in useAppNavigation.ts so the new route is reachable for your target user state.

Issue: Wrong Back Button Text

Problem: Back button shows “(tabs)” or route name. Solution: Set custom back title:

Best Practices

1. Consistent Screen Structure

  • Use ScreenContainer for layout consistency
  • Follow the established padding/margin patterns
  • Use theme colors via useTheme()

2. Navigation Naming

  • Use kebab-case for route names: "feature-name"
  • Keep route names descriptive but concise
  • Match file names to route names when possible

3. Header Configuration

  • Always set meaningful title
  • Use appropriate presentation for UX
  • Customize headerBackTitle for better navigation context

4. Navigation Guards

  • Update redirect rules in useAppNavigation.ts when adding new flows
  • Consider authentication requirements
  • Test navigation flows thoroughly

Example: Complete Feature Screen

Here’s a complete example following all best practices: File: apps/mobile/app/ai-chat.tsx
AppStack Registration:
Navigation from FeatureCard:
This pattern provides a consistent, maintainable approach to adding new feature screens to the Launch mobile app.

Troubleshooting

  • Screen not accessible: check route group and auth/onboarding guards
  • Header not updating: update the correct layout file

Next Steps