How do I clear location.state in react-router on page reload?
<p>I am currently passing my state on route change like below:</p>

<pre><code>&lt;Link to={{
           pathname:`/transactions/${props.transaction.id}`,
           state: {transaction: props.transaction}
         }}&gt; View Details &lt;/Link&gt;
</code></pre>

<p>My logic is that if "location.state.transaction" exists, don't fetch new data, else, fetch data.</p>

<p>Now the flaw is when there is a page reload. The application needs to fetch new data if the user reloads the page. I thought "location.state" would get cleared if there is a reload, but apparently the state is saved in sessionStorage.</p>

<p>How do I work around this? 
I could just fetch new data every time, but it should not fetch data when the 'View Details' Link is clicked.</p>