re: Working with conditions & lists in React VIEW POST

re: What do you advise to use then ? Ternary is expression and inside jsx expressions are the only way to do condition Btw don't tell me to create a f...

I think if you reach the point of having a lot of ternaries or too much nested ternaries, maybe, that component should be split in multiple components because the original one becomes too complex.

But most of the time ternaries are not a problem IMO and you can use them without issues, most probably before you reach the point ternaries are a problem you have another problem and already split the component.

code of conduct - report abuse