htm bound to vhtml translates a numeric zero value as an empty string.
To reproduce
import htm from 'htm'
import vhtml from 'vhtml'
const html = htm.bind(vhtml)
let count = 0
console.info(html`<h1>The count is →${count}←</h1>`)
count++
console.info(html`<h1>The count is →${count}←</h1>`)
Expected result
<h1>The count is →0←</h1>
<h1>The count is →1←</h1>
Actual result
<h1>The count is →←</h1>
<h1>The count is →1←</h1>
The (yucky) workaround
html`<h1>The count is →${count.toString()}←</h1>`
(I’m not sure if its htm or vhtml to blame here as I haven’t had a chance to dig into it; just strumbled on this while trying to reproduce a different issue.)
htm bound to vhtml translates a numeric zero value as an empty string.
To reproduce
Expected result
Actual result
The (yucky) workaround
(I’m not sure if its htm or vhtml to blame here as I haven’t had a chance to dig into it; just strumbled on this while trying to reproduce a different issue.)