Re:Statements vs. Expressions
by amadeuspagel on Thursday July 14, 2022 @07:05AM
(#32094372)
> I think we often blame React for seemingly arbitrary rules, like how components must return a single top-level element. But more often than not, React is just warning us about a JavaScript limitation.
Really? With lit you can create a component that has several top-level elements[1].
EDIT: In fact this works even in react/preact with htm[2], so it's just a limitation of JSX.
Really? With lit you can create a component that has several top-level elements[1].
EDIT: In fact this works even in react/preact with htm[2], so it's just a limitation of JSX.
[1]: https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1n...
[2]: https://github.com/developit/htm