yelouafi / petit-dom

minimalist virtual dom library
MIT License
501 stars 36 forks source link

Changing VNode type at root fails #32

Closed j-sen closed 4 years ago

j-sen commented 4 years ago

Changing type of VNode at root fails. Version: 0.3.3

` import { h, render } from "petit-dom";

const parentElement = document.getElementById("app");

render(h("h1", null, "Hello"), parentElement); render(h("h2", null, "Hello"), parentElement); `

The code above makes the browser complain

TypeError: Cannot read property 'childNodes' of undefined

Here is a link to sandbox for reproducing: https://codesandbox.io/s/confident-knuth-o41be

yelouafi commented 4 years ago

should be fixed in v0.3.4