We will go through two examples of using some open REST APIs. First, we will make a React app that shows the current weather in London. The weather is fetched from OpenWeatherMap (https://openweathermap.org/). You need to register with OpenWeatherMap to get an API key. We will use a free account as that is sufficient for our needs. When you have registered, navigate to your account info to find the API keys tab. There, you'll see the API key that you need for your React weatherapp:
Let's create a new React app with create-react-app. Open PowerShell, or another terminal you are using, and type the following command:
npx create-react-app weatherapp
Move to the weatherapp folder:
cd weatherapp
Start your app with the following command:
npm start
Open your project folder with VS Code and open the App.js file in the editor view. Remove all code inside...