I have a Web application which is targeted for mobile users but since our client doe not want a mobile app, it is developed using React. I have implemented in-app routing using React Router. I use useHistory hook so basically use history object for navigation. I want to keep the in-app navigation and browser navigation in sync.
Now the requirement is I have a payments page. When user completes his payment procedure, user should not be able to go back to any of the pages involved in the payment process. Or simply if user hits back button, he should land up on home page. So I thought of clearing the history so that user wont be able to go back. But it seems there is no way in react to clear the history.
Please let me know if anyone knows any solutions.