title: getInitialProps import data in Next.js
body: <p>I have a simple page in <code>NEXT.js</code> for example like this:</p>
  
  <pre><code>function Page({ stars }) {
      return &lt;div&gt;Next stars: {stars}&lt;/div&gt;;
  }
  
  Page.getInitialProps = async ({ req }) =&gt; {
      const res = await fetch('https://api.github.com/repos/zeit/next.js');
      //console.log(res) shows data at-it-is, -raw
      const json = await res.json();
      return { stars: json.stargazers_count };
  };
  
  export default Page;
  </code></pre>
  
  <p>and a data-set from API <code>https://directmarketaccess.ru/api/curves/curves/3</code>
  in such format which is needed for Google React Chart in exactly the same view at they are like:</p>
  
  <pre><code>[
     [header1,..headerX]
     ...
     [valueY,...valueY]
  ]
  </code></pre>
  
  <p>It's not an <code>object</code> with <code>{}</code> it's an <code>array</code> of <code>arrays</code></p>
  
  <blockquote>
    <p>According to the dataset from Google Charts <a href="https://github.com/RakanNimer/react-google-charts/blob/HEAD/sandboxes/linechart/index.js" rel="nofollow noreferrer">Demo line chart</a> - array of arrays is fine</p>
  </blockquote>
  
  <p>I spent almost two days for understanding this case and such tutorials like:</p>
  
  <ul>
  <li><a href="https://nextjs.org/learn/excel/lazy-loading-modules/lazy-loading" rel="nofollow noreferrer">https://nextjs.org/learn/excel/lazy-loading-modules/lazy-loading</a></li>
  <li><a href="https://nextjs.org/learn/basics/fetching-data-for-pages" rel="nofollow noreferrer">https://nextjs.org/learn/basics/fetching-data-for-pages</a></li>
  </ul>
  
  <p>and searching for answers from google/SO/etc. Probably I don't understand something or missing a trivial thing, but in some cases after importing data with <code>getInititalProps</code> even after <code>console.log(res)</code> stage, I receive error every time when I'm trying to import everything that isn't an object with properties. The funny thing is, that after all the experiments <code>console.log(res)</code> show data correctly, even if server refure to render page for me. So what if necessary data are a <code>string</code>, <code>number</code>, <code>array</code>, but not an <code>object</code> (let skip part where typeof array === object). How to import data in necessary format with or without <code>getInitialProps</code>?</p>
  
  <p>Is there any way to import data on page as-they-are (for example from async function in other file, that connecting to DB (mongo) and receiving data from it) or I always should use <code>fetch</code> from API which should sent me <code>object</code> with <code>{prop: value}</code> model?</p>