DEV Community

Discussion on: Axios: My experience with the library.

Collapse
 
jcubic profile image
Jakub T. Jankiewicz • Edited

Axios is not using async/await. Your code do that and it's JavaScript, the same is with native fetch. async/await is syntax sugar for promises that is not part of Axios it's part of JavaScript. Axios is just using promises it don't uses async/await. So the same will be with any library that use promises.
Here is example of native fetch API:

var res = await fetch('url');
var data = await res.json();
Enter fullscreen mode Exit fullscreen mode

see you also don't need to use .then(), this have nothing to do with axios.

Thread Thread
 
gabrlcj profile image
Gabriel Bittencourt

I see, I appreciate your explanation on the topic!