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
Navigation
Properties
getId?
optionalgetId?: ({ 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?
optionalinitialParams?:Partial<ParamList[RouteName]>
Initial params object for the route.
layout?
optionallayout?: (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?
optionallisteners?:ScreenListeners<State,EventMap> | ((props) =>ScreenListeners<State,EventMap>)
Event listeners for this screen.
name
name:
RouteName
Route name of this screen.
navigationKey?
optionalnavigationKey?: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?
optionaloptions?:ScreenOptions| ((props) =>ScreenOptions)
Navigator options for this screen.