Cannot render empty array
lazex opened this issue · comments
lazex commented
If the array is empty, render is failed.
import { html, render } from "uhtml"
render(
document.querySelector('#app'),
html`
<h1>foo</h1>
<div>${[]}</div>
`
)
The error is here.
Failed to execute 'setStartBefore' on 'Range': parameter 1 is not of type 'Node'.
Andrea Giammarchi commented
Ooops, silly mistake, fixed, thanks!
Andrea Giammarchi commented
to clarify, this issue was happening only if you start with an empty array ... now that's fixed, changing from non-empty to empty then non-empty again worked well, sorry for the issue.