|
|
|
|
|
by scrollaway
3419 days ago
|
|
Frankly, yes it does hurt readability. I used to have your mindset and you're making the assumption that what looks okay when creating one single element will look fine when nesting dozens (which react excels at). JSX is well defined and does not support any of HTML's looseness. It's predictable. It makes the code easier to follow. And if you don't want to use it, you don't have to. I see no issue. |
|
Nesting dozens of items is fine. That single line was more of an HN comment format limitation. This might be a better judge of readability:
C#
http://imgur.com/a/nVWdC
JSX
http://imgur.com/a/qwAfD
You may prefer one or the other but most would admit they are pretty similar its just that the former hasn't needed an entire new language inlined into it. Given JSX has all its angle brackets, end tags and escaping expressions with {}, it can actually be more verbose.