Skip to main content

Skipping a route

The backward navigation navigates 1 path before by default, but there is an option to include a flag in order to skip paths on back navigation. If you want to activate this, you need to include the flag when you do a forward navigation. Let's put an example to explain that.

1 - We are on currentView and we push a new route.

historyPush({
path: `new/firstView`,
skipCurrentOnBack: true
});

2 - Now, in the new/firstView we perform a new navigation

historyPush({
path: `new/secondView`
});

3 - Now we would be on the component new/secondView. So if we perform a back navigation, the expected route is the component currentView because when we pushed the new/firstView one, we added the flag skipCurrentOnBack to true

historyBack()

4 - The current view is currentView again.