Re:Maud: A Rust macro for writing HTML
by the_gipsy on Thursday June 09, 2022 @01:39PM
(#31684294)
You're just stating the difference between a statement and an expression. FYI, other languages (e.g. rust) have embraced the "everything is an expression" and it works extremely well, where JSX wouldn't be so awkward (in this aspect) and we could write something like:
Now, if you want to write this in actual JSX, you have to do this:
Do you see the contradiction of being forced to use only expressions, only in some places? And this happens all the time. The most frequent thing we do in UI is rendering lists, so we use `.map` with "regular" code constantly, mixed with the awkward "expressions only" areas. Sure, the reason is that JavaScript is like that, but that doesn't make JSX any better.
[ Parent
| on HN ]
There are no comments on this comment yet.