diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2023-07-23 18:17:59 +0100 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2023-07-23 18:17:59 +0100 |
commit | 796642e3037053245b8fc05fc89da3d41d5425c2 (patch) | |
tree | e47e4807d6dedcf350280406eb6a21d75dbe3147 /src/lustre.ffi.mjs | |
parent | 069846f09022a3a978e09f1a25f452850c104ddd (diff) | |
download | lustre-796642e3037053245b8fc05fc89da3d41d5425c2.tar.gz lustre-796642e3037053245b8fc05fc89da3d41d5425c2.zip |
:bug: Fix bugs with vdom patching when removing elements or rendering into components.
Diffstat (limited to 'src/lustre.ffi.mjs')
-rw-r--r-- | src/lustre.ffi.mjs | 6 |
1 files changed, 2 insertions, 4 deletions
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() { |