I see why you might find this cumbersome although to be honest I got used to it pretty quick and it stopped being a problem for me a few months into React.
In fact I found the ability to use any JS constructs liberating because as soon as the condition got more complicated I could extract it in a variable, a function call, a switch statement, an object property lookup, or any other valid JS code.
That said we do have some ideas about allowing something like
Interesting... Yeah, I can totally see how abstracting complex conditions into a variable can be useful. I guess it makes a lot of sense - it's all just javascript in the end.
Thanks for the answer!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I see why you might find this cumbersome although to be honest I got used to it pretty quick and it stopped being a problem for me a few months into React.
In fact I found the ability to use any JS constructs liberating because as soon as the condition got more complicated I could extract it in a variable, a function call, a
switch
statement, an object property lookup, or any other valid JS code.That said we do have some ideas about allowing something like
to work (see this proposal).
Interesting... Yeah, I can totally see how abstracting complex conditions into a variable can be useful. I guess it makes a lot of sense - it's all just javascript in the end.
Thanks for the answer!