title: Detect previous path in react router if i came from an outside application?
body: <p>I am using react router. I want to detect the previous page (outside app example: coming from gmail to my application) from where I am coming from. I have the router in my context. But, I don't see any properties like "previous path" or history on the router object. How do I do it?</p>
  
  <p>example 2: user places an order we send them an email confirmation via email where onclick on <code>view-order-details</code> they are navigated back to our web app, now how to detect which link they came from?</p>
  
  <p><em>Here's another context to understand better</em></p>
  
  <p>I have to implement a back button in my web app, when user comes from email to my webapp he's navigated to <code>https://example.com/orders/{orderID}</code> directly and if i just use <code>props.history.goBack</code> it'll go back to email page. But i want to user to be navigated to <code>https://example.com/dashboard</code>. </p>
  
  <p>Now you might say use <code>props.history.push('/dashboard'</code>) this will become static value. if user is navigated internally(not coming from email or external page) from <code>dashboard-&gt;all-orders-&gt;orders/{orderID}</code> on click of back button should be navigated to <code>dashboard-&gt;all-order</code>s page and not to dashboard.</p>