The ResetStack
action creates a new screen with the given route and destroys the previous stack.
The structure of ResetStack
is:
Attribute | Type | Required | Definition |
---|---|---|---|
route | Route | ✓ | Navigation route. |
controllerId | String | The id of the navigation controller to use during the navigation action. If absent, the default navigation controller will be used instead. | |
navigationContext | NavigationContext | Context to be saved on the target screen. |
This is an example of a simple screen with a button that performs the ResetStack action when clicked. To test it, just add the screen URL you want to create and click on the button. The new screen will be created on a new stack, and the previous stack will be destroyed (any other existing stack will not be affected).
Screen(
child = Button(
text = "Click me!",
onPress = listOf(
Navigate.ResetApplication(
Route.Remote(NEW_SCREEN_ENDPOINT)
)
)
)
)
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.