title: React Js : .map is not a function
body: <p>I have json array as below -</p>
  <pre><code>[{&quot;sup_Id&quot;:6,&quot;sup_ShortCode&quot;:&quot;A&quot;},{&quot;sup_Id&quot;:7,&quot;sup_ShortCode&quot;:&quot;B&quot;},{&quot;sup_Id&quot;:8,&quot;sup_ShortCode&quot;:&quot;C&quot;},{&quot;sup_Id&quot;:1000,&quot;sup_ShortCode&quot;:&quot;D&quot;}]
  </code></pre>
  <p>React component reading this array as -</p>
  <pre><code>import React,{useEffect,useState} from 'react'
  import axios from 'axios';
  function AllSuppliers() {
      const [suppliers, setstate] = useState([])
      useEffect(() =&gt; {
          // GET request using axios inside useEffect React hook
          axios.get('http://localhost:62815/api/values/GetAllSuppliers')
              .then(x =&gt; setstate({suppliers:x.data}))
              .catch(error =&gt; {
                  alert(error);
                  
              });;
      }, []);
      return (
          &lt;&gt;
              &lt;table style={{width: '50%'}}&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                  &lt;th&gt;
                      Supplier Id
                  &lt;/th&gt;
                  &lt;th&gt;
                      Supplier Name
                  &lt;/th&gt;
                  
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  {
                     
                      suppliers.map((supplier)=&gt;supplier)
                  }
              &lt;/table&gt;
          &lt;/&gt;
      )
  }
  
  export default AllSuppliers
  </code></pre>
  <p>I am getting -</p>
  <blockquote>
  <p>TypeError: suppliers.map is not a function</p>
  </blockquote>
  <p>error</p>
  <p>I also tried with - <code>suppliers[0].map</code> since its an array. But this also did not worked.</p>