Skip to content
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

Consider going straight to React syntax #19

Open
ssorallen opened this issue Feb 24, 2015 · 3 comments
Open

Consider going straight to React syntax #19

ssorallen opened this issue Feb 24, 2015 · 3 comments

Comments

@ssorallen
Copy link
Contributor

The JSX transformer is designed to take string input in a certain syntax and convert it to React syntax. However, htmltojsx.js does not work with strings: it works with a DOM tree structure. HTMLtoJSX could skip JSX syntax and instead output React.createElement calls, eliminating the need for the JSX transformer.

Is this feasible?

@Daniel15
Copy link
Member

HTMLtoJSX just builds JSX at the moment. It does not use any parts of JSXTransformer. It could definitely be modified to output regular JavaScript rather than JSX. I'll add it as an option. Thanks for the suggestion!

@mummybot
Copy link

👍

@dant00ine
Copy link

The output of the convert function on my HTML is returning a string -- I suppose this is the intended behavior but I'd ideally like to use the output as raw JSX. Is this possible?

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

No branches or pull requests

4 participants