title: TypeError: Cannot read property 'map' of undefined,, trying to read from mongodb
body: <p>/// I am following a turorial from youtube,
  <a href="https://www.youtube.com/watch?v=nUbNn0voiBI&amp;t=88s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=nUbNn0voiBI&amp;t=88s</a>
  and faced an error,</p>
  <p>Proxy error: Could not proxy request /notes from localhost:3000 to https://localhost:3001/.
  See <a href="https://nodejs.org/api/errors.html#errors_common_system_errors" rel="nofollow noreferrer">https://nodejs.org/api/errors.html#errors_common_system_errors</a> for more information (EPROTO).</p>
  <pre><code>
  function Notes(){
      const [notes, setNotes] = useState([{
          name: '',
          email: '',
          phone: '',
          message: ''
      }])
  
      useEffect(() =&gt; {
          fetch(&quot;/notes&quot;).then(res =&gt; {
              if(res.ok) {
                  return res.json()
              }
          }).then(jsonRes =&gt; setNotes(jsonRes));
      })
  
      return &lt;div className=&quot;container&quot;&gt;
          &lt;h1&gt;Notes page&lt;/h1&gt;
          {notes.map(note =&gt; 
              &lt;div&gt;
                  &lt;h1&gt;{note.name}&lt;/h1&gt;
                  &lt;p&gt;{note.email}&lt;/p&gt;
                  &lt;p&gt;{note.phone}&lt;/p&gt;
                  &lt;p&gt;{note.message}&lt;/p&gt;
              &lt;/div&gt;            
              )}
      &lt;/div&gt;
  }
  
  export default Notes;```
  </code></pre>