I want to redirect the user to a new page using next/router but i want that particular page should not be added to the users browser navigation history. I don’t want the user to go to that page using the browser back button.
currently i am using
window.location.href ="/new-page"
But i don’t like this approach i want to stay with native next js code and don’t want to use window object.
New contributor
Arsam Farooq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.