How correct to back on the first page

I have page0, page1, page2, page3.
On the page3 the view has history: page0, page1, page2, page3.
Then I need to back to page0. I wrote the following code:

view.router.back(’/page0/’, { force: true });

After that I get to the page0, but the history changed to: page0, page1, page0.
But I just need to go back to the first page0.

I wonder if a direct link isnt enough

I need to return on the first page but not navigate. In other words page0 should be animated from left to right.

I figured out the problem. I did not use page url correctly. As result I use the following code:
view.router.back(view.router.history[0], { force: true })

1 Like