title: how to get the previous route the user came from in react
body: <p>I am trying to get the url of the previous page I came from in react.</p>
  <p>So if I came from <code>xxx.com/register</code>, and am now on <code>...com/profile</code>, then how do I log that in the console?</p>
  <p>I have no clue where to start. Does anyone know how to do this? Is this possible in <code>react</code>? Should I use <code>js</code> instead?</p>