Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

benleong94
Copy link

No description provided.

const [hourlyData, setHourlyData] = useState(null);
const [error, setError] = useState();

const handleChange = (event) => {
Copy link
Contributor

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);
}

Copy link
Contributor

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([
Copy link
Contributor

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 }

Copy link
Contributor

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'

Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants