fix: wrong previous dom used in diffing

This commit is contained in:
Ayo 2023-12-08 22:13:34 +01:00
parent 3c1b3b0893
commit 85284e9e42

View file

@ -181,7 +181,7 @@ export class WebComponent extends HTMLElement {
const tree = this.template;
// TODO: smart diffing
if (JSON.stringify(this.prev) !== JSON.stringify(tree)) {
if (JSON.stringify(this.#prevDOM) !== JSON.stringify(tree)) {
// render
const el = createElement(tree);
if (el) {