axios is a popular open source JavaScript HTTP client. We're going to build a little React app that creates, reads, updates, and deletes posts from the JSONPlaceholder REST API. Along the way, we'll discover some of the benefits of axios over fetch. Our first job in the next section is to install axios.
Using axios with class components
Installing axios
Before we install axios, we are going to quickly create our little React app:
- In a folder of our choice, let's open Visual Studio Code and its Terminal and enter the following command to create a new React and TypeScript project:
npx create-react-app crud-api --typescript
Note that the version of React we use needs to be at least version 16.7.0-alpha.0. We...