Closed NotBobTheBuilder closed 9 years ago
Not a bug. Anything within a JSX expression which is not a JSX tag becomes a text node. Thus the #
becomes literal text, and is not interpreted as a comment.
Consider this JS equivalent compiled with the official JSX transformer:
<Foo>
<Bar />
// <Baz /> leaving baz unimplemented
</Foo>
becomes
React.createElement(Foo, null,
React.createElement(Bar, null),
"// ", React.createElement(Baz, null), " leaving baz unimplemented"
)
Ah ok - if that’s upstream behaviour (which I find a bit weird, but hey ho) then following it seems like the right thing to do.
Thanks :)
In the code
I’d expect the comment to be ignored - instead, it seems to be parsed and placed into the function call, as follows:
I’m assuming this is a bug, and I attached a failing test case.