r/reactjs • • Feb 23 '20

Needs Help Beginner requesting a code review and advice

[deleted] — view deleted post

45 Upvotes

25 comments sorted by

View all comments

Show parent comment

3

u/annoying_mammal Feb 23 '20

You will always render the weatherdata regardless but since the fields are empty the h3 headers well not render. But you need to wrap the image in a condition so it will not be rendered unless weatherdata.icon is not an empty string.