developit / htm

Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
Apache License 2.0
8.64k stars 169 forks source link

Is there a plug-in to use "html2react" and "htm" together? #211

Open masx200 opened 2 years ago

masx200 commented 2 years ago

Is there a plug-in to use "html2react" and "htm" together?

https://www.npmjs.com/package/html2react


const html = htm.bind(html2react);

let reactvdom=html` 
  <h1 class="foo"
>Foo</h1>
  <p><a href="#" style="text-decoration: none;">Bar</a></p>
  <p onclick=${()=>{}}>Baz</p>
`

For example, the attribute "class" is converted to "className", and the attribute "style" is converted from a string to an object?the attribute "onclick" is converted to "onClick".

masx200 commented 2 years ago

https://github.com/developit/htm/issues/212

It seems that you cannot use "babel-plugin-htm" and "babel-plugin-react-html-attrs" together at compile time?