r/reactjs • • Feb 23 '20

Needs Help Beginner requesting a code review and advice

[deleted] — view deleted post

44 Upvotes

25 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 23 '20

[deleted] — view deleted 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.