title: Can't export data using getStaticProps() - Nextjs
body: <p>Hi I am trying to implement server side rendering with react and NextJS. I am trying to pull some information from an API that can use on my home page but I am running into some issues. for instance as seen in my code below,, &quot;the property 'map' does not exist on type&quot;. My code is as follows:</p>
  <pre><code>import type { NextPage } from 'next'
  import Head from 'next/head'
  import Header from '../components/Header'
  import Banner from '../components/Banner'
  
  const Home: NextPage = (exploreData) =&gt; {
    return (
      &lt;div className=&quot;&quot;&gt;
        &lt;Head&gt;
          &lt;title&gt;Don Airbnb&lt;/title&gt;
          &lt;link rel=&quot;icon&quot; href=&quot;/favicon.ico&quot; /&gt;
        &lt;/Head&gt;
  
      
        &lt;Header/&gt;
        {/*Banner*/}
        &lt;Banner/&gt;
  
        &lt;main className=&quot;max-w-7xl mx-auto px-8 sm:px-16&quot;&gt;
          &lt;section className=&quot;pt-6&quot;&gt;
            &lt;h2 className=&quot;text-4xl font-semibold pb-5&quot;&gt;Explore Nearby&lt;/h2&gt;
  
            {/* Pull data from a server - API endpoints */}
            {exploreData.map(item =&gt; {
              &lt;h1&gt;{item.location}&lt;/h1&gt;
            })}
          &lt;/section&gt;
        &lt;/main&gt;
  
      &lt;/div&gt;
    )
  }
  
  export async function getStaticProps() {
    const exploreData = await fetch('https://links.papareact.com/pyp').then(res =&gt; res.json());
    return {
      props: {
        exploreData
      }
    }
  }
  
  </code></pre>
  <p>However I am getting the following error:</p>
  <pre><code>Server Error
  Error: page / getStaticProps can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member
  </code></pre>
  <p>How can I solve this problem?</p>