score:23

Accepted answer

axios.get() returns an AxiosResponse<any> object, where response.data is any.

axios.get<Todo[]>() returns an AxiosResponse<Todo[]> object, where response.data is Todo[].

So you can type response as:

const response: AxiosResponse<Todo[]> = await axios.get("blabla");

Related Query

More Query from same tag