title: How do I render a list from Json data in express js, then render it using react and map()?
body: <p>I had a question, and a problem when rendering Json data with react js. I Couldn't get react to map out the data. Here is my code:</p>
  <p>My Json:</p>
  <pre><code>res.json({
      list: [{id: 1, name: 'Caleb'}, {id: 2, name: 'Isaiah'}]
  })
  </code></pre>
  <p>My React Code:</p>
  <pre><code>import { useState, useEffect } from 'react'
    
  function App() {
  
    const [data, setData] = useState({})
  
    useEffect(() =&gt; {
      fetch(&quot;/home&quot;)
      .then(res =&gt; res.json())
      .then(data =&gt; setData(data))
    }, [])
  
    return (
      &lt;div&gt;
          {data.list.map(function(d, idx){
           return (&lt;li key={idx}&gt;{d.name}&lt;/li&gt;)
         })}
      &lt;/div&gt;
    );
  }
    
  export default App;
  </code></pre>
  <p>Its giving me this error, that it cant render it properly.</p>