I have Navigation structure like this
Profile Screen
Settings Screen
Ad Screen
Now i want to navigate from Settings Screen to Ad Screen , but I want to delete from history Settings Screen.
I tried "NavigationActions.reset(" but I want a simple one solution
>Solution :
You can use :
navigation.replace("AdScreen")
replace
Replaces the current screen with a new screen in the stack. The method accepts following arguments:
-
name – string – Name of the route to push onto the stack.
-
params – object – Screen params to pass to the destination route.
https://reactnavigation.org/docs/stack-navigator/#replace