WebReflection / uhtml

A micro HTML/SVG render

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot render empty array

lazex opened this issue · comments

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'.

Ooops, silly mistake, fixed, thanks!

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.