Making AJAX Requests In React

From Littledamien Wiki
Revision as of 18:39, 17 March 2018 by Video8 (talk | contribs) (Created page with "Category:ReactCategory:Web Development == Overview == Notes on how to use an AJAX request to fill out the state of a React component. == AJAX libraries == It's nece...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

Notes on how to use an AJAX request to fill out the state of a React component.

AJAX libraries

It's necessary to use a library to make AJAX calls. These libraries are independent of React. They are installed with NPM. [1]

  • Axios
    Apparently Axios is a little more compact than fetch, e.g. with fetch it's necessary to convert AJAX responses to JSON; with Axios that step is automatic. And error handling is supposed to be better with axios.[2]
  • superagent
  • fetch

Notes