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

2

u/cant_have_nicethings Feb 23 '20

Nested ternaries are fine. There was no reasoning provided with the feedback so I would disregard.

2

u/folkrav Feb 23 '20 edited Feb 24 '20

Nested ternaries come with a bunch of gotchas depending on the language and get very unreadable very quickly. They're usually very clever, and clever code is rarely good code.

They can be fine, they seldom end up being so.