-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weather App (Ben) #5
base: main
Are you sure you want to change the base?
Conversation
const [hourlyData, setHourlyData] = useState(null); | ||
const [error, setError] = useState(); | ||
|
||
const handleChange = (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont need to wrap setCity in handleChange
const handleChange = (event) => { | ||
setCity(event.target.value); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can try to come back and add in a .env for practice
.then((response) => response.data[0]) | ||
.then((cityGeoData) => { | ||
const cityData = cityGeoData; | ||
return Promise.all([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of promise all to return a set of data and an API call
<div>Temperature: {weatherData.main.feels_like}</div> | ||
<div>Weather: {weatherData.weather[0].main}, {weatherData.weather[0].description}</div> | ||
</div> : null } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work getting the hourly data
@@ -0,0 +1,41 @@ | |||
import React from 'react' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work creating this component well done!
No description provided.