I am doing an online quiz application in PHP. I want to restrict the user from going back in an exam.
I have tried the following script, but it stops my timer.
I had this problem with React (class component).
And I solved it easily:
componentDidMount() { window.addEventListener("popstate", e => { this.props.history.goForward(); } }
I've used HashRouter from react-router-dom.
HashRouter
react-router-dom