Type alias NavigationState<ParamList>

NavigationState<ParamList>: Readonly<{
    history?: unknown[];
    index: number;
    key: string;
    routeNames: Extract<keyof ParamList, string>[];
    routes: NavigationRoute<ParamList, keyof ParamList>[];
    stale: false;
    type: string;
}>

Type Parameters

Type declaration

  • Optional history?: unknown[]

    Alternative entries for history.

  • index: number

    Index of the currently focused route.

  • key: string

    Unique key for the navigation state.

  • routeNames: Extract<keyof ParamList, string>[]

    List of valid route names as defined in the screen components.

  • routes: NavigationRoute<ParamList, keyof ParamList>[]

    List of rendered routes.

  • stale: false

    Whether the navigation state has been rehydrated.

  • type: string

    Custom type for the state, whether it's for tab, stack, drawer etc. During rehydration, the state will be discarded if type doesn't match with router type. It can also be used to detect the type of the navigator we're dealing with.