I am navigating from one page to another using history.push which is available from below
import { withRouter } from 'react-router-dom
I am able to navigate properly but i have a requirement that if i move from Page A to Page B, i should not be allowed to go back to previous page using Browser back button.
I know this can be achieved by window.redirect but i dont want to use that. The problem with that is the entire state and redux store information is lost. Does anyone know if i can use withRouter and still be able to achieve the requirement above.
browserHistory.replaceinstead ofbrowserHistory.pushto remove A from browsing history. That way if user goes to B, he won't be able to go to A, instead go to a URL previous of A. - Kanishk Anand