-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments in cjsx #13
Comments
Official JSX doesn't support comments and I'm not particularly inclined to add |
It would be really nice to have some way of doing this — could we make |
That wouldn't really make sense. Hash-comments go to the end of the line, so how would we differentiate a curly bracket which is just part of the comment from one which closes a coffeescript expression in JSX markup? |
I would add a special case for when the curly brace is at the end of the line. At the moment it's a syntax error, so it won't break anyone's existing code.
|
+1 |
Before this change it was not possible to comment inside CJSX templates. * jsdf#40 * jsdf/coffee-react#13 After this change, you can use the syntax: {#this is a cjsx comment} The syntax was designed to look like a CJSX_ESCAPE that contains a comment, but as the resulting coffee-script would be illegal this is special-cased by the parser to return nothing. Future work would be needed make this syntax work inside a tag: <Person {#comment} /> or to make multiline comments work: <Person>{### ###}</Person>
I've sent a pull request that implements my suggestion above, would love to get some feedback :). |
I'm not sure since when, but JSX does seem to support comments: |
Interesting. I'm in favour of implementing comments with the same semantics as JSX |
Would love to see the JSX comments added {/* comment */} |
@chasedeanda you can now use {# comment }, which does the same thing :) |
Thanks! |
Can i use comments in html part of cjsx?
Thanks!
The text was updated successfully, but these errors were encountered: