r/reactjs • u/swyx • Jul 01 '18
Help Beginner's Thread / Easy Question (July 2018)
Hello! just helping out /u/acemarke to post a beginner's thread for July! we had almost 550 Q's and A's in last month's thread! That's 100% month on month growth! we should raise venture capital! /s
Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple. You are guaranteed a response here!
New to React? Free, quality resources here
- Read the new, official Getting Started page on the docs
- /u/acemarke's suggested resources for learning React and his React/Redux links list.
- Kent Dodds' Egghead.io course
- Tyler McGinnis' 2018 Guide
- Codecademy's React courses
Want Help on Code?
- Improve your chances of getting helped by putting a minimal example on to either JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new). Describe what you want it to do, and things you've tried. Don't just post big blocks of code.
- If you got helped, pay it forward! Answer questions even if there is already an answer - multiple perspectives can be very helpful to beginners. Also there's no quicker way to learn than being wrong on the Internet.
51
Upvotes
View all comments
Show parent comment
3
u/en-aye-ese-tee-why Jul 02 '18
Fetch is a webapi. It requires no outside package to use or polyfills for most major browsers and essentially is a replacement of XMLHttpRequest (XHR).
I might be wrong but previously request libraries were just wrappers around the XMLHttpRequest API, this includes jQuery's request functionality and probably Axios, though I never looked at the source code for Axios. Mostly people were looking for an Async solution that could use Promises rather than callback functions.
Libraries like Axios just come with some bells and whistles like allowing you to set default headers and create interceptors. The Fetch API is sorta new so that's why there are so many alternatives as essentially other libraries were built out to make things easier.
This is the general gist of it. I could be wrong about some of this stuff so if someone else knows better feel free to correct me.