Making API calls in React
Now that the basic application is running, we can start performing an API call to our backend. For this, we will mainly focus on the front_end/src/App.js file. We can build up our application so that it can populate the frontend with items from our Rust application. First we must add the following to the dependencies of our package.json file:
"axios": "^0.26.1"
Then, we can run the following command:
npm install
This will install our extra dependency. Now, we can turn to our front_end/src/App.js file and import what we need with the following code:
import React, { Component } from 'react';
import axios from 'axios';
We are going to use Component for our App class inheritance and axios to perform API calls to our backend. Now, we can define our App class and update our state with the following code:
class App extends Component {
  state = {
      "pending_items...