Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created April 18, 2021 19:15
Show Gist options
  • Save AllGistsEqual/917056541b0edfa37863e42b7e337eb7 to your computer and use it in GitHub Desktop.
Save AllGistsEqual/917056541b0edfa37863e42b7e337eb7 to your computer and use it in GitHub Desktop.
// File: src/routing/routes.ts
import { createStackNavigator } from '@react-navigation/stack'
export enum MainRoutes {
Splash = 'Splash',
Loading = 'Loading',
Home = 'Home',
Settings = 'Settings',
}
export type MainStackParamList = {
[MainRoutes.Splash]: undefined
[MainRoutes.Loading]: undefined
[MainRoutes.Home]: { update: boolean } | undefined // just an example, "update" will later be used for version checks
[MainRoutes.Settings]: undefined
}
export const MainStack = createStackNavigator<MainStackParamList>()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment