From 796642e3037053245b8fc05fc89da3d41d5425c2 Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Sun, 23 Jul 2023 18:17:59 +0100 Subject: :bug: Fix bugs with vdom patching when removing elements or rendering into components. --- src/lustre.ffi.mjs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/lustre.ffi.mjs') diff --git a/src/lustre.ffi.mjs b/src/lustre.ffi.mjs index 39ba9ec..38b3a95 100644 --- a/src/lustre.ffi.mjs +++ b/src/lustre.ffi.mjs @@ -10,7 +10,6 @@ import { Ok, Error, isEqual } from "./gleam.mjs"; /// export class App { #root = null; - #el = null; #state = null; #queue = []; #effects = []; @@ -68,8 +67,7 @@ export class App { } destroy() { - this.#root = null; - this.#el.remove(); + this.#root.remove(); this.#state = null; this.#queue = []; this.#effects = []; @@ -83,7 +81,7 @@ export class App { const node = this.#view(this.#state); const vdom = map(node, (msg) => this.dispatch(msg)); - this.#el = morph(this.#root, vdom); + morph(this.#root, vdom); } #tick() { -- cgit v1.2.3