ResetStack

ResetStack action details and its attributes

What is it?

The ResetStack action creates a new screen with the given route and destroys the previous stack.

The structure of ResetStack is:

AttributeTypeRequiredDefinition
routeRouteNavigation route.
controllerIdStringThe id of the navigation controller to use during the navigation action. If absent, the default navigation controller will be used instead.
navigationContextNavigationContextContext to be saved on the target screen.

How to use?

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)
            )
        )
    )
)

Last modified March 7, 2022: fix: Update docs 2.0 (#858) (4368557d)