title: Reverse state on browser back button in reactjs
body: <p>For a consistent user experience, I'd like my react app to reverse its state when the user clicks the browser back button.</p>
  
  <p>For example, if I change an element in the state with a function call:</p>
  
  <pre><code>  changeVar = (idx) =&gt; (event) =&gt; {
      this.setState({thisIndex: idx});
      //how to notify browser stack of this change?
    }
  </code></pre>
  
  <p>How could I add this to the browser stack so that users can click the back button in the browser to reverse the state change?</p>