NavigationContainer
Own the navigation state for an app's screen tree.
App.tsx
<NavigationContainer onStateChange={syncRoutes}> <NotebookStack /></NavigationContainer>Notes
Routes in the root stack
Import NavigationContainer from react-nitro-navigation and wrap the app's outermost navigator. Nested navigators belong inside screens of that tree so their routes participate in the same navigation state.
import { createStackNavigator, NavigationContainer } from 'react-nitro-navigation'
import { Text } from 'react-nitro-renderer'
const Stack = createStackNavigator<{ Notes: undefined }>()
function Notes() {
return <Text>My notes</Text>
}
export function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Notes" component={Notes} />
</Stack.Navigator>
</NavigationContainer>
)
}To open a second screen with the native back action, follow the navigation walkthrough.