title: how to use a type for the response from axios.get
body: <p>I have a simple code to fetch data via Axios:</p>
  
  <pre><code>const response= await axios.get("blabla");
  </code></pre>
  
  <p>and now I'm trying to use typescript. </p>
  
  <p>When I add the type to the get method it works:</p>
  
  <pre><code>const response= await axios.get&lt;Todo[]&gt;("blabla");
  </code></pre>
  
  <p>but what i need is something like:</p>
  
  <pre><code>const response:Todo[] = await axios.get("blabla");
  </code></pre>
  
  <p>but if i do that i get an error on <code>response.data</code> saying: <em>Property 'data' does not exist on type 'Todo[]'</em></p>
  
  <p>so 2 questions:
  1) why didn't it happen for the first approach?
  2) how to do the second way?</p>