Closed zpao closed 10 years ago
@zpao Thanks. I knocked this out as a proof-of-concept and only just started wiring it up into a project.
It looks like I don't even need to wrap these in array, but can just pass them in as successive args.
React.DOM.ul(null,
React.DOM.li(null, "List Item"),
React.DOM.li(null, dynamicListItem)
)
I'll poke around with this later tonight, or feel free to send a PR.
Okay, this commit fixes the concatenation issue by generating args instead. It looks like JSX requires a root node.
@zpao Do you have any suggestions for a fallback strategy? I could force a shim node, but my inclination is just to make the compiler complain.
I won't have time to send any PRs, sorry. And honestly, I don't like Jade syntax, just want to help you help others who might :)
I think letting React complain is fine. We do the same with JSX. It keeps the transform simpler and forces the issue up to the developer instead of magically inserting nodes.
Thanks for the feedback, really appreciated.
Concatenation is very much the wrong thing to do with siblings. You should instead be creating arrays.
is converting to (with newlines to aid reading)
but it should convert to