Skip to content

Marina's weather app#54

Open
Mannushka wants to merge 9 commits intorocketacademy:mainfrom
Mannushka:main
Open

Marina's weather app#54
Mannushka wants to merge 9 commits intorocketacademy:mainfrom
Mannushka:main

Conversation

@Mannushka
Copy link
Copy Markdown

No description provided.

Comment thread src/App.js
Comment on lines +66 to +68
{this.state.weatherData &&
this.state.weatherData.length > 0 &&
this.state.weatherData.map((location) => (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{this.state.weatherData &&
this.state.weatherData.length > 0 &&
this.state.weatherData.map((location) => (
{this.state.weatherData.map((location) => (

This would be sufficient. An array is always truthy, thus this.state.weatherData is always true.
When running .map() on an empty array, we do not run the callback function, so just running map directly is totally fine.

Comment thread src/App.js
))}
</div>
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

textbook implementation, perfect!

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