diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2023-08-20 07:46:20 +0100 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2023-08-20 07:46:20 +0100 |
commit | fddee047ca9dc855f6591b33ab9bd520068d93fa (patch) | |
tree | 61546796d2de40e856095af56b7c18f4b73776a0 | |
parent | 00f258dc7a305fe683d473aa6c6e526fa0b68d9c (diff) | |
download | lustre-fddee047ca9dc855f6591b33ab9bd520068d93fa.tar.gz lustre-fddee047ca9dc855f6591b33ab9bd520068d93fa.zip |
:bug: Fixed bug: it's #root not $root!
-rw-r--r-- | lib/src/lustre.ffi.mjs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/src/lustre.ffi.mjs b/lib/src/lustre.ffi.mjs index 10524e0..520a3ae 100644 --- a/lib/src/lustre.ffi.mjs +++ b/lib/src/lustre.ffi.mjs @@ -35,12 +35,12 @@ export class App { if (!is_browser()) return new Error(new NotABrowser()); if (this.#root) return new Error(new AppAlreadyStarted()); - this.$root = + this.#root = selector instanceof HTMLElement ? selector : document.querySelector(selector); - if (!this.$root) return new Error(new ElementNotFound()); + if (!this.#root) return new Error(new ElementNotFound()); const [next, effects] = this.#init(flags); @@ -84,7 +84,7 @@ export class App { const node = this.#view(this.#state); const vdom = map(node, (msg) => this.dispatch(msg)); - this.#root = morph(this.#root, vdom); + this.#root = morph(this.#root, vdom, this.#root.parentNode); } #tick() { |