title: Pass object one page to another page using Link in React Js
body: <p>I need to pass object one page to another page. According to requirement, I need to do it using &quot;Link&quot; tag. this is my code.</p>
  <p>1st page is as below</p>
  <pre><code>&lt;Link  
          to={{
            pathname: &quot;/2ndPage&quot;,
            state: { foo: 'bar'} 
          }}
        &gt; Action&lt;/Link&gt;
  </code></pre>
  <p>When I click this button, I need to pass object to my second page. this is my second page code that I tried</p>
  <pre><code>function 2ndPage(props) {
  console.log(props)
    return &lt;h1&gt;Hello&lt;/h1&gt;;
  }
  </code></pre>
  <p>correctly project build successfully. When I click my first page button, page is redirect correctly. But object did not pass. I think this is wrong approach. can u help me to do this.</p>