Skip to content

API Reference / @gtkx/navigation / NavigationContainerRef

Type Alias: NavigationContainerRef<ParamList> ​

NavigationContainerRef<ParamList> = NavigationHelpers<ParamList> & EventConsumer<NavigationContainerEventMap> & object

Type Declaration ​

getCurrentOptions() ​

getCurrentOptions(): object | undefined

Get the currently focused route's options.

Returns ​

object | undefined

getCurrentRoute() ​

getCurrentRoute(): MaybeParamListRoute<ParamList> | undefined

Get the currently focused navigation route.

Returns ​

MaybeParamListRoute<ParamList> | undefined

getParent() ​

getParent(): undefined

Stub function for getParent on navigation object for use with useNavigation.

Returns ​

undefined

getRootState() ​

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

Get the rehydrated navigation state of the navigation tree.

Returns ​

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

isReady() ​

isReady(): boolean

Whether the navigation container is ready to handle actions.

Returns ​

boolean

resetRoot() ​

resetRoot(state?): void

Reset the navigation state of the root navigator to the provided state.

Parameters ​

state? ​

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

Navigation state object.

Returns ​

void

setOptions() ​

setOptions(): never

Stub function for setOptions on navigation object for use with useNavigation.

Returns ​

never

Type Parameters ​

ParamList ​

ParamList extends object