title: NextJS: Send a JSON object to another page
body: <p>I'm starting with NextJS and React. I've developed a page A where I retrieve data (a JSON object) from an API (using getServerSideProps() to do it in each request time) and then I show it. Then, I've some IconButtons to push and go to another page B. That's working ok. Then, which is the right way to send that JSON object to the page B to show some elements?</p>
  <p>The code I've done is something like this:</p>
  <p>Page A:</p>
  <pre><code>import React from &quot;react&quot;;
  import Head from &quot;next/head&quot;;
  import { params } from &quot;../components/ApiParams&quot;;
  import fetch from &quot;node-fetch&quot;;
  
  const Chapter = ({ response }) =&gt; {
    return (
      &lt;div&gt;
        &lt;Head&gt;
          &lt;title&gt;Chapter&lt;/title&gt;
        &lt;/Head&gt;
  
        &lt;div&gt;
        {response.data.mainValue}
        &lt;IconButton href=&quot;/chapters/secondPage&quot;&gt;
                  &lt;ChevronRightIcon /&gt;
        &lt;/IconButton&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    );
  };
  
  const getFetch = async (params) =&gt; {
    const chapterUrl = `https://localhost/chapter/data-provider`;
    const response = fetch(chapterUrl, params);
    return response;
  };
  
  export const getServerSideProps = async (context) =&gt; {
    try {
      const res = await getFetch(params);
      const response = await res.json();
      return { props: { response } };
    } catch (error) {
      console.log(&quot;Error in getServerSideProps function: &quot;, error);
    }
  };
  
  export default Chapter;
  
  </code></pre>
  <p>Page B:</p>
  <pre><code>import React from &quot;react&quot;;
  import Head from &quot;next/head&quot;;
  
  export default function secondPage(){
     return(
            //Here I want use the response object I've got from API in Page A.
  );
  }
  </code></pre>
  <p>So, how is the right way to send that response object to Page B? Thanks in advance.</p>