Intercept/handle browser's back button in React-router?
<p>I'm using Material-ui's Tabs, which are controlled and I'm using them for (React-router) Links like this:</p>

<pre><code>    &lt;Tab value={0} label="dashboard" containerElement={&lt;Link to="/dashboard/home"/&gt;}/&gt;
    &lt;Tab value={1} label="users" containerElement={&lt;Link to="/dashboard/users"/&gt;} /&gt;
  &lt;Tab value={2} label="data" containerElement={&lt;Link to="/dashboard/data"/&gt;} /&gt;
</code></pre>

<p>If I'm currenlty visting dashboard/data and I click browser's back button
I go (for example) to dashboard/users but the highlighted Tab still stays on dashboard/data (value=2)</p>

<p>I can change by setting state, but I don't know how to handle the event when the browser's back button is pressed?</p>

<p>I've found this:</p>

<pre><code>window.onpopstate = this.onBackButtonEvent;
</code></pre>

<p>but this is called each time state is changed (not only on back button event)</p>