Skip to content

HTMLtoJSX does not convert curly brackets #42

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

Closed
optimalisatie opened this issue Jan 28, 2016 · 2 comments
Closed

HTMLtoJSX does not convert curly brackets #42

optimalisatie opened this issue Jan 28, 2016 · 2 comments

Comments

@optimalisatie
Copy link

Issue copied from React:Issues.

I am experiencing a problem with the HTMLtoJSX converter (https://www.npmjs.com/package/htmltojsx), the same converter as officially displayed on https://facebook.github.io/react/html-jsx.html.

The HTML-code <div>{</div> is compiled to the following JSX-code:

<div>{</div>

https://facebook.github.io/react/html-jsx.html

The JSX code fails with the following error:

Uncaught SyntaxError: embedded: Unexpected token (7:18)
   5 | var Hello = React.createClass({
   6 |   render: function() {
>  7 |     return <div>{</div>;
     |                   ^
   8 |   }
   9 | });

Test: https://jsfiddle.net/69z2wepo/28714/

Does anyone know a solution for the problem?


Reply from @Daniel15
Good catch, thanks for reporting this! As @zpao mentioned, please file this in the react-magic repo so I remember to fix it :)

@solugebefola
Copy link
Contributor

I have put in a pull request with my fix.

@Daniel15
Copy link
Member

Should be fixed by #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants