How to Handle REST API Requests in React

Written by Kerron King | Published 2020/03/18
Tech Story Tags: react | javascript | rest-api | web-development | nodejs | reactjs | api | axios

TLDR Axios is an npm package that allows apps to send requests to web APIs. It is available for use in React 17 but is now considered 'departure' Axios requests were utilised within the React lifecycle method 'componentWillMount' This method has since been departured but it is still available at the time of this writing. To use Axios within your React app, use the following commands: import React and Axios into the file as follows:receive-request-response-response.via the TL;DR App

no story

Written by Kerron King | Trini | Web-Dev | Geo
Published by HackerNoon on 2020/03/18