title: ReactJS: How to fix TypeError: data is not iterable
body: <p>I have two applications running at the same time. The first one is fetching APIs from <a href="https://api.vesselfinder.com/docs/vesselslist.html" rel="nofollow noreferrer">vessel-finder</a> and finding only a specific number of boats.
  The second application is the user interface used to visualize data from the fetch, specifically latitude and longitude of boats.</p>
  
  <p><strong>The problem</strong> I have is that the fetch seems to arrive correctly to the end point but that throws an error of <code>TypeError: data is not iterable</code> as also shown <a href="https://i.imgur.com/Q8fzDqf.png" rel="nofollow noreferrer">here</a> on the terminal.</p>
  
  <p>It seems that the problem might be the API fetch. Below the code I am using for that:</p>
  
  <pre><code>router.get('/hello', async function(req, res, next) {
      try {
          const { data } = await axios.get(
              'https://api.vesselfinder.com/vesselslist?userkey=KEY'
          );
          const [ metaData, ships ] = data;
          console.log(data);
          res.send(data);
      } catch (error) {
          res.send(error);
          console.log(error);
      }
  });
  
  module.exports = router;
  </code></pre>
  
  <p>While investigating what the problem might be, I came across <a href="https://www.freecodecamp.org/forum/t/typeerror-map-is-not-a-function/346460" rel="nofollow noreferrer">this source</a> which also uses <code>axios</code> to get the call to the API.
  I wonder now if the fetch I am making is basically incomplete and because of that, <code>data is not iterable</code>...
  Also from <a href="https://stackoverflow.com/questions/60626008/node28917-unhandledpromiserejectionwarning-typeerror-data-is-not-iterable">this post</a> I was able to handle a missing <code>Promise</code> using a <code>try-catch</code> block that was preventing me from compiling.</p>
  
  <p>Is the problem due to a missing <code>axios.get('API call').then.setState</code> instruction I am missing?, if so how could I fix that?</p>
  
  <p>Thank you very much for pointing to the right direction for solving this problem.</p>