Today I learned

March 31, 2020

Replace axios with fetch

Axios is a npm package which makes http requests easier. At the time axios came out, making http requests in the browser was not really fun and axios made the life of a lot of developers easier.

Since then a lot of things changed. A native fetch API is now available. Kent C. Dodds wrote a blogpost why you might not need axios anymore and can replace it easily with fetch.

Check it out: https://kentcdodds.com/blog/replace-axios-with-a-simple-custom-fetch-wrapper

Greetings Marco

Go back to other today-I-learned posts