Split.Screen

Register a route in a split navigator and open it beside the sidebar.

App.tsx
navigation.showDetail('Note', {  title: 'River walk',})navigation.push('Info')
Notes
Beside the sidebarNothing open
Open a note, push its info, then open the other note. Showing a detail closes what was open beside the sidebar.

Inside a Split.Navigator, give each Split.Screen a route name and a React component. The first screen is the sidebar. Type the route parameters when creating the navigator. The options callback can then read those parameters to set the navigation bar title.

For a Note route declared as { title: string }, open a note from the sidebar and use its title in the bar.

<Split.Screen
  name="Note"
  component={Note}
  options={({ route }) => ({ title: route.params.title })}
/>
const navigation = useNavigation<SplitNavigationProp<Routes>>()
navigation.showDetail('Note', { title: 'River walk' })

showDetail shows the screen beside the sidebar and closes the screens opened from the sidebar before. A screen with getId that is already open for the same id stays open, as with push. push keeps the other screens and adds the screen on top. On one stack, both push the screen above the sidebar. Split.Navigator

Props

Supply name and exactly one of component, getComponent, or children.

PropTypeUse
nameRoute nameRequired. A unique route name from this navigator’s parameter list.
componentReact componentRender this component with the route and navigation props.
getComponent() => ComponentResolve the screen component on demand.
childrenRender callbackReturn screen content from the route and navigation props.
optionsSplitNavigationOptions or callbackConfigure this screen. A callback receives the route, navigation and theme.
initialParamsPartial route paramsSet initial values for the route parameters.
getId({ params }) => string | undefinedDerive an identity for this screen from its route parameters.
navigationKeystringChange this key to remove or reset existing routes with this name.
listenersListeners or callbackSubscribe to events for this screen.
layoutRender callbackWrap this screen’s rendered content.

Screen options

These fields go inside options or screenOptions.

OptionTypeUse
titlestringNative navigation bar title. Defaults to the route name.
headerShownbooleanShow the native navigation bar. Defaults to true.
headerTintColorColorValueColor the navigation bar title and back button. Defaults to the system color.
onAndroidBackPress() => voidHandle Android system Back while this screen is focused. The sidebar is focused while no screen is open from it.
inspectorReactNodeThis screen's inspector, a panel about it that shows in a trailing column or a sheet. Show an inspector
inspectorTitlestringTitle of the inspector's navigation bar, which takes this screen's headerTintColor. Defaults to none.

On this page