Technical requirements
A GitHub repository has been created to host all the code we’ll discuss in this book. For this chapter, you can find the recommended structure at https://github.com/PacktPublishing/React-Anti-Patterns/tree/main/code/src/ch12.
We need to complete a few more steps before we proceed. Please follow the next section to set up the necessary API keys.
Getting the OpenWeatherMap API key
To utilize OpenWeatherMap, you’ll need to create an account at https://openweathermap.org/. Although various plans are available based on usage, the free plan suffices for our purposes. After registering, navigate to My API keys to find your API key, as displayed in Figure 12.1:
Keep a copy of this key handy as we’ll use it to make calls to the weather API so that we can fetch data.
Preparing the project’s code base
If you prefer to follow along with me, you will need to install...