Axios: Using this lib in typescript : how to include axios and others like AxiosRequestConfig ?

Created on 1 Sep 2016  ·  3Comments  ·  Source: axios/axios

Currently I'm using this:

import axios from 'axios';
import { AxiosRequestConfig, AxiosPromise } from 'axios';

Which seems a bit strange, is there a better way ?

Most helpful comment

You can use this instead:

import axios, { AxiosRequestConfig, AxiosPromise } from 'axios';

All 3 comments

You can use this instead:

import axios, { AxiosRequestConfig, AxiosPromise } from 'axios';

Thanks for the answer.

this took me forever to figure out...

Was this page helpful?
0 / 5 - 0 ratings