3 ms·
When I first started using React, I was very concerned about the lack of template support for conditionals. In practice, I've find that I now segregate heavy l
by debaserab2 10y ago
When I first started using React, I was very concerned about the lack of template support for conditionals.
In practice, I've find that I now segregate heavy logic into it's own function, which ends up making my components very readable. The lack of first class support for conditionals as a part of JSX has forced me to encapsulate code better.
I would say the only trade-off I've noticed is I end up losing a little bit of DRY-ness here and there with some components having near identical functions. I think it's an acceptable trade off as long as functions are small.