react-magic
react-magic copied to clipboard
Consider going straight to React syntax
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?
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!
👍
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?