Skip to content

API Reference / @gtkx/navigation / RouteConfigProps

Type Alias: RouteConfigProps<ParamList, RouteName, State, ScreenOptions, EventMap, Navigation> ​

RouteConfigProps<ParamList, RouteName, State, ScreenOptions, EventMap, Navigation> = object

Type Parameters ​

ParamList ​

ParamList extends ParamListBase

RouteName ​

RouteName extends keyof ParamList

State ​

State extends NavigationState

ScreenOptions ​

ScreenOptions extends object

EventMap ​

EventMap extends EventMapBase

Navigation

Properties ​

getId? ​

optional getId?: ({ params, }) => string | undefined

Function to return an unique ID for this screen. Receives an object with the route params. For a given screen name, there will always be only one screen corresponding to an ID. If undefined is returned, it acts same as no getId being specified.

Parameters ​

{ params, } ​
params ​

Readonly<ParamList[RouteName]>

Returns ​

string | undefined


initialParams? ​

optional initialParams?: Partial<ParamList[RouteName]>

Initial params object for the route.


layout? ​

optional layout?: (props) => React.ReactElement

Layout for this screen. Useful for wrapping the screen with custom containers. e.g. for styling, error boundaries, suspense, etc.

Parameters ​

props ​

ScreenLayoutArgs<ParamList, RouteName, ScreenOptions, Navigation>

Returns ​

React.ReactElement


listeners? ​

optional listeners?: ScreenListeners<State, EventMap> | ((props) => ScreenListeners<State, EventMap>)

Event listeners for this screen.


name ​

name: RouteName

Route name of this screen.


optional navigationKey?: string

Optional key for this screen. This doesn't need to be unique. If the key changes, existing screens with this name will be removed or reset. Useful when we have some common screens and have conditional rendering.


options? ​

optional options?: ScreenOptions | ((props) => ScreenOptions)

Navigator options for this screen.