score:16

the history of pages you visit in your web browser is like a stack data structure. you can either push a new record onto the top of the history stack or you can replace the top record. if you use push, and then hit the browser's back button, it will take you back to the page you are currently on, but if you use replace it will take you two pages back.

score:26

the router history works like a stack of routes. when you use the router.replace, you're overwritting the top of the the stack. when using the router.push, it adds a new route to the top of the stack.

the router history allows you to go back to the last page. for example, when the user navigates to a invalid route, you can use the router.replace to prevent the user to navigate back to the invalid route.


Related Query

More Query from same tag