In this exercise, you will use state with an API to make a weather app!
The result should look like:
- Fork this repo to your account
- Clone it
cd react-weather-app
npm install
npm start
This is the API endpoint to get the forecast:
https://my-json-server.typicode.com/evyros/react-weather-app/forecast
- Make a component named
Forecast1Day
that will contain the forecast for 1 day. This component should receive all info with props. - Use the API to get the JSON and loop it to display the forecast.
- For your convenience, there is an
icons
directory with the images of all days. - Please note, that the API doesn't give you the day of the week in a text format. Instead, it provides the number of the day of the week (0-6). Sunday is 0, Saturday is 6. You will have to format it by yourself.