How am I supposed to use this library with React hooks? I'm getting "Invalid hook call" errors trying to use functional Components:
import { html } from 'htm/react'
const Form = props => {
useEffect(() =< {
// do something
})
return html`<form></form>`
}
// then on a index.html file
<div id="main"></div>
<script type="module">
import htm from 'https://unpkg.com/htm?module'
import React from 'https://cdn.skypack.dev/react'
import reactDOM from 'https://cdn.skypack.dev/react-dom'
import Form from './bundle.js'
const html = htm.bind(React.createElement)
reactDOM.render(
html`
<${Form} />
`,
document.getElementById('main')
)
</script>
How am I supposed to use this library with React hooks? I'm getting "Invalid hook call" errors trying to use functional Components: