htm
htm copied to clipboard
Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.
I am using "htm" with "preact" binding When I'm using code like the following ``` render(html` `, document.body) ``` "htm" handles the ids differently: * `` and `` get an...
When running the following code: ```javascript import htm from 'https://unpkg.com/htm?module' function h(type, props, ...children) { return { type, props, children }; } const html = htm.bind(h); console.log( html` bold regular...
```js function Carousel(props) { let images = props.images.split(","); images.map(image => image.trim()); let mainImage = ``; let minis = ""; images.forEach(imageUrl => { minis = minis.concat(``) }) console.log('a',images,minis) console.log(html` ${mainImage} Tro...
Noticed this was missing. I also stumbled on https://github.com/developit/htm/issues/175#issuecomment-773755560 which I'm wondering if it should also be done for `preact`.
Couldn't find anything, I think I can try to make this myself as an exercise if no one is working this already.
The babel plugin has a "monomorphic" option to always return options, but it seems like htm proper (or possibly that's the preact integration) returns raw children. Is there some way...
https://github.com/developit/htm/blob/d62dcfdc721e47bc1923a2cb7a01ebd594ab0c25/src/integrations/preact/index.d.ts#L4 this returns VNode, while if you do `htm.bind(h)` the inferred return type is `VNode | VNode[]` https://github.com/developit/htm/blob/d62dcfdc721e47bc1923a2cb7a01ebd594ab0c25/src/index.d.ts#L2-L4 Which one of the two types is correct? Should this be changed...
When I have ` ` in htm, it's outputting as literally ` ` in the html. I've seen some [similar questions for JSX](https://stackoverflow.com/questions/37909134/nbsp-jsx-not-working), but it seems that, even there, the space should...
https://unpkg.com/htm/preact/standalone.module.js does not export (or even seem to contain) `createRef`, despite #222 being merged for a long time now.