mlmorg / react-hyperscript

Hyperscript syntax for React.js markup
MIT License
711 stars 45 forks source link

jsx2hyperscript helper? #42

Open aaronyo opened 5 years ago

aaronyo commented 5 years ago

Anyone know of a simple tool (cmd line would be fine) for converting a JSX snippet to a react-hyperscript snippet? My use case is making it easy to plop JSX examples into my code which is not setup for JSX.

I googled a bit and didn't find anything...

Sorry if this is an inappropriate place to post this. I guess I'm trying to slide it in under "feature suggestion..."

davenquinn commented 3 years ago

I find that running Babel (usually I just use the REPL on their website) gets most of the way there. Then I can replace React.createElement with h and reformat