title: How can i print a list of objects from API? .map don't reading the data
body: <p>when i use the <code>.map</code> to print all companies in my page gives the following issue (TypeError cias.map is not a function):</p>
  <p><a href="https://i.stack.imgur.com/iDeFl.png" rel="nofollow noreferrer">Error</a></p>
  <p>Code:</p>
  <pre><code>import fetch from 'isomorphic-unfetch'
  import Link from 'next/link'
  import { Container } from '../../../styles/pages/container'
  import React from 'react'
  import { GetStaticProps } from 'next'
  import { Cias } from '../../../../model/cias'
  
  export interface CiasProps {
    cias: Cias[]
  }
  
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
  export default function CiasBrazil({ cias }: CiasProps) {
    return (
      &lt;Container&gt;
        {console.log(cias)}
        &lt;ul&gt;
          {cias.map(cia =&gt; {
            ;&lt;li className=&quot;cia&quot; key={cia.Code}&gt;
              &lt;Link
                href=&quot;/companies/brazil/[id]&quot;
                as={`/companies/brazil/${cia.Code}`}
              &gt;
                &lt;a&gt;
                  &lt;span&gt;{cia.Name}&lt;/span&gt;
                &lt;/a&gt;
              &lt;/Link&gt;
            &lt;/li&gt;
          })}
        &lt;/ul&gt;
      &lt;/Container&gt;
    )
  }
  
  export const getStaticProps: GetStaticProps = async ({ params }) =&gt; {
    const res = await fetch('http://localhost:3000/api/infocadcias')
    const cias = await res.json()
    return { props: { cias } }
  }
  </code></pre>
  <p>Cias interface:</p>
  <pre><code>export interface Cias {
    Code: number
    Name: string
  }
  </code></pre>
  <p>API:</p>
  <p><a href="https://i.stack.imgur.com/73jC8.png" rel="nofollow noreferrer">API</a></p>