From e5021187e96b78b53203bd95d08d6818aea47d17 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Wed, 14 Jul 2021 15:10:31 +0200 Subject: New Ignite 7.0.6 app --- app/navigators/root-navigator.tsx | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/navigators/root-navigator.tsx (limited to 'app/navigators/root-navigator.tsx') diff --git a/app/navigators/root-navigator.tsx b/app/navigators/root-navigator.tsx new file mode 100644 index 0000000..2c04f29 --- /dev/null +++ b/app/navigators/root-navigator.tsx @@ -0,0 +1,59 @@ +/** + * The root navigator is used to switch between major navigation flows of your app. + * Generally speaking, it will contain an auth flow (registration, login, forgot password) + * and a "main" flow (which is contained in your MainNavigator) which the user + * will use once logged in. + */ +import React from "react" +import { NavigationContainer, NavigationContainerRef } from "@react-navigation/native" +import { createStackNavigator } from "@react-navigation/stack" +import { MainNavigator } from "./main-navigator" +import { color } from "../theme" + +/** + * This type allows TypeScript to know what routes are defined in this navigator + * as well as what properties (if any) they might take when navigating to them. + * + * We recommend using MobX-State-Tree store(s) to handle state rather than navigation params. + * + * For more information, see this documentation: + * https://reactnavigation.org/docs/params/ + * https://reactnavigation.org/docs/typescript#type-checking-the-navigator + */ +export type RootParamList = { + mainStack: undefined +} + +const Stack = createStackNavigator() + +const RootStack = () => { + return ( + + + + ) +} + +export const RootNavigator = React.forwardRef< + NavigationContainerRef, + Partial> +>((props, ref) => { + return ( + + + + ) +}) + +RootNavigator.displayName = "RootNavigator" -- cgit v1.2.3