Today I learned
Replace axios with fetch
Axios Opens in new tab 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 Opens in new tab 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
I hope you enjoyed this post and learned something new. If you have any questions, feel free to reach out to me via Email Opens in new tab.
If you want to support me, you can buy me a coffee. I would be very happy about it!
☕️ Buy me a coffee ☕️I wish you a wonderful day! Marco