3 ms·
Ask HN: What's wrong with including code in JSX?
I read comment threads where people are really against code being in JSX.
But I do it all the time. I figure that if I can write an extremely terse function inline then the overall complexity of the code is decreased.
I don't see much point in creating functions for one or two liners that will only be called from one place in the code.
So why am I wrong? What's the inherent problem with putting code in JSX?
- dmitriid 9y agoThere’s no inherent problem with putting code in JSX as long as it’s not a complex function spanning multiple screens :)