title: getting error to display fetch data in table react native
body: <p>I'm getting an error as undefined is not a function (near'...tableData.map').</p>
  <p>how to fix this problem ? And i want to display fetch data inside the table.</p>
  <p>my api format is something like:</p>
  <h2>id  | FName | LName | Contact</h2>
  <h2>01  |  Ash  | John  | 567828</h2>
  <p>02  | David | Wark  | 129352</p>
  <p>i want my data in the table something similar this. how can i display fetch data inside the table in this format.</p>
  <pre><code>const [tableData, setTableData] = useState(TD);
  
  useEffect(() =&gt; {
    async function getData() {
      fetch('https://www.lampmonitor.com/lampmonitor/api/auth/web/lampControls?projectId=595&amp;pageSize=50')
      .then(responce =&gt; responce.json())
      .then(data =&gt; {
        setTableData({data});
      });
    }
  
    getData();
  
  
  return (
    &lt;View style={styles.container}&gt;
      &lt;ScrollView horizontal={true}&gt;
        &lt;View&gt;
          &lt;Table borderStyle={{borderWidth: 1, borderColor: '#C1C0B9'}}&gt;
            &lt;Row
              data={tableData.tableHead}
              widthArr={tableData.widthArr}
              style={styles.header}
              textStyle={styles.text}
            /&gt;
          &lt;/Table&gt;
          &lt;ScrollView style={styles.dataWrapper}&gt;
            &lt;Table borderStyle={{borderWidth: 1, borderColor: '#C1C0B9'}}&gt;
              {tableData.map((rowData, index) =&gt; (
                &lt;Rows
                  key={index}
                  data={rowData}
                  widthArr={tableData.widthArr}
                   style={[
                     styles.row,
                     index % 2 &amp;&amp; {backgroundColor: '#F7F6E7'},
                   ]}
                  textStyle={styles.text}
                /&gt;
              ))}
            &lt;/Table&gt;
          &lt;/ScrollView&gt;
        &lt;/View&gt;
      &lt;/ScrollView&gt;
    
    &lt;/View&gt;
  );
  </code></pre>