title: React Router -- Differentiate goBack() and goForward() in listen()
body: <h1>Issue</h1>
  
  <p>With React Router v4, how do I differentiate between <code>goBack()</code> and <code>goForward()</code> calls with the <code>listen()</code> method?</p>
  
  <p>As far as I can tell, the <code>location</code> and <code>action</code> parameters don't give enough info to distinguish. The <code>action</code> argument is <code>POP</code> for both back and forward.</p>
  
  <pre class="lang-js prettyprint-override"><code>history.listen((location, action) =&gt; {
    // action = 'POP' when goBack() and goForward() are called.
  }
  </code></pre>
  
  
  
  <p>I'm using the <a href="https://github.com/ReactTraining/history" rel="noreferrer">history</a> node module.</p>
  
  <h1>Purpose</h1>
  
  <p>I have a breadcrumbs component whose items are held in state. When the user goes back, I need to pop the last breadcrumb.</p>