title: React - Pass data in React Router
body: <p>So, I'm having a hard time passing data between two unrelated components. I have this code below, but I don't know how to receive it from the other component</p>
  <pre><code>&lt;Button
     className='search__button'
     variant=&quot;contained&quot;
     color=&quot;primary&quot;
     size=&quot;large&quot;
     component={Link}
     to={{
       pathname: &quot;/home&quot;,
       state: { data: results }
     }}
  &gt;
  </code></pre>
  <p>I want to pass the variable &quot;results&quot; which is a Map of a string and an object Book (Map&lt;string, Book&gt;) to a component. Basically, my question is, how do I retrieve data in my Home component?</p>
  <p>Thank you</p>