From fddee047ca9dc855f6591b33ab9bd520068d93fa Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Sun, 20 Aug 2023 07:46:20 +0100 Subject: :bug: Fixed bug: it's #root not $root! --- lib/src/lustre.ffi.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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() { -- cgit v1.2.3