Closed spoerri closed 3 years ago
How can traditional react components be used from htm?
React-widgets seem to work off-the-shelve with preact-compat and jsx, but not with htm...
import { html, Component } from 'htm/preact'; import style from './style'; import Multiselect from 'react-widgets/lib/Multiselect'; import 'react-widgets/dist/css/react-widgets.css'; export default class Profile extends Component { render({}, {}) { //return <div class={style.profile}><Multiselect data={['alphabet','alfalfa','broccoli']} /></div>; //jsx works return html`<div class=${style.profile}><Multiselect data=${['alphabet','alfalfa','broccoli']} /></div>`; //htm doesn't work yet... } }
Or, how would a javascript noob go about debugging this? In chrome's Elements view, the htm version has this showing up as simply \
Duh, it needs to be \<${Multiselect}. Created a README PR to make it a little clearer :)
How can traditional react components be used from htm?
React-widgets seem to work off-the-shelve with preact-compat and jsx, but not with htm...
Or, how would a javascript noob go about debugging this? In chrome's Elements view, the htm version has this showing up as simply \