Skip to content

API Reference / @gtkx/navigation / NavigationProp

Type Alias: NavigationProp<ParamList, RouteName, NavigatorID, State, ScreenOptions, EventMap>

NavigationProp<ParamList, RouteName, NavigatorID, State, ScreenOptions, EventMap> = Omit<NavigationHelpersCommon<ParamList, State>, "getParent"> & object & NavigationHelpersRoute<ParamList, RouteName> & EventConsumer<EventMap & EventMapCore<State>> & PrivateValueStore<[ParamList, RouteName, EventMap]>

Defined in: node_modules/.pnpm/@react-navigation+core@7.21.13_react@19.2.8/node_modules/@react-navigation/core/lib/typescript/src/types.d.ts:441

Type Declaration

getParent()

getParent<T>(id?): T

Returns the navigation prop from a parent navigator based on the ID. If an ID is provided, the navigation prop from the parent navigator with matching ID (including current) will be returned. If no ID is provided, the navigation prop from the immediate parent navigator will be returned.

Type Parameters

T

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

Parameters

id?

NavigatorID

Optional ID of a parent navigator.

Returns

T

setOptions()

setOptions(options): void

Update the options for the route. The options object will be shallow merged with default options object.

Parameters

options

Partial<ScreenOptions>

Returns

void

Type Parameters

ParamList

ParamList extends object

RouteName

RouteName extends keyof ParamList = Keyof<ParamList>

NavigatorID extends string | undefined = string | undefined

State

State extends NavigationState = NavigationState<ParamList>

ScreenOptions

ScreenOptions extends object = { }

EventMap

EventMap extends EventMapBase = { }

Released under the MPL-2.0 License.