aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2023-08-20 07:46:20 +0100
committerHayleigh Thompson <me@hayleigh.dev>2023-08-20 07:46:20 +0100
commitfddee047ca9dc855f6591b33ab9bd520068d93fa (patch)
tree61546796d2de40e856095af56b7c18f4b73776a0
parent00f258dc7a305fe683d473aa6c6e526fa0b68d9c (diff)
downloadlustre-fddee047ca9dc855f6591b33ab9bd520068d93fa.tar.gz
lustre-fddee047ca9dc855f6591b33ab9bd520068d93fa.zip
:bug: Fixed bug: it's #root not $root!
-rw-r--r--lib/src/lustre.ffi.mjs6
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() {