Skip to content

Weather App (Ben)#5

Open
benleong94 wants to merge 1 commit into
rocketacademy:mainfrom
benleong94:main
Open

Weather App (Ben)#5
benleong94 wants to merge 1 commit into
rocketacademy:mainfrom
benleong94:main

Conversation

@benleong94
Copy link
Copy Markdown

No description provided.

Comment thread src/App.jsx
const [hourlyData, setHourlyData] = useState(null);
const [error, setError] = useState();

const handleChange = (event) => {
Copy link
Copy Markdown
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

Comment thread src/App.jsx
const handleChange = (event) => {
setCity(event.target.value);
}

Copy link
Copy Markdown
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

Comment thread src/App.jsx
.then((response) => response.data[0])
.then((cityGeoData) => {
const cityData = cityGeoData;
return Promise.all([
Copy link
Copy Markdown
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

Comment thread src/App.jsx
<div>Temperature: {weatherData.main.feels_like}</div>
<div>Weather: {weatherData.weather[0].main}, {weatherData.weather[0].description}</div>
</div> : null }

Copy link
Copy Markdown
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

Comment thread src/WeatherTable.jsx
@@ -0,0 +1,41 @@
import React from 'react'

Copy link
Copy Markdown
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