title: 'await' has no effect on the type of this expression
body: <p>I searched about this but I didn't find anything specific for what I need. If there is one, please, share here.</p>
  
  <p>I'm trying to create a generic service to be called in various components. Since it's a function that requests data from an external source, I need to treat it as an asynchronous function. Problem is, the editor returns the message "'await' has no effect on the type of this expression". And the app indeed crashes since there is no data yet.</p>
  
  <p><strong>People.js calls the service requests.js</strong></p>
  
  <pre><code>import React, { useEffect, useState } from "react";
  import requests from "../services/requests";
  
  export default () =&gt; {
  
     // State
     const [ people, setPeople ] = useState({ count: null, next: null, previous: null, results: [] });
  
     // Tarefas iniciais
     useEffect(() =&gt; {
         carregarpeople(1);
     }, []);
  
     // Carregando os dados da API
     const carregarpeople = async (pageIndex) =&gt; {
         const peopleResponse = await requests("people", pageIndex);
  
         // This line below needs to be executed but it crashes the app since I need to populate it with the data from the function requests
         // setPeople(peopleResponse);
     }
  
  
     return (
         &lt;div&gt;
         {
             people.results.length &gt; 0 ? (
                 &lt;ul&gt;
                     {
                         people.results.map(person =&gt; &lt;li key = { person.name }&gt;{ person.name }&lt;/li&gt;)
                     }
                 &lt;/ul&gt;    
             ) : &lt;div&gt;Loading...&lt;/div&gt;
         }
         &lt;/div&gt;
     )
    }
  </code></pre>
  
  <p><strong>And this is requests.js, where it returns the json from API</strong></p>
  
  <pre><code>export default (type, id) =&gt; {
  console.table([ type, id ]);
  
  fetch(`https://swapi.co/api/${type}/?page=${id}`)
  
  .then(response =&gt; response.json())
  .then(json =&gt; {
      console.log(json);
      return json;
  })}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TMZTj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TMZTj.png" alt="enter image description here"></a></p>