title: Controlling Browser Back button in React
body: <p>I want to make my web app works like a mobile app. This means when a user presses back, they expect pops to close, not entire pages to change.</p>
  
  <p>My end goal is to make it so when a modal opens the Back button will now close the modal and if they click it again it will go back.</p>
  
  <p>I've tried several methods and although close they never respond consistently.
  <a href="https://codesandbox.io/s/github/subwaymatch/react-disable-back-button-example-v2" rel="noreferrer">https://codesandbox.io/s/github/subwaymatch/react-disable-back-button-example-v2</a></p>
  
  <p>Anyone with a PROVEN working version of what I'm looking for?</p>