diff --git a/shared/static/wasm/sx/boot.sx b/shared/static/wasm/sx/boot.sx index a5b319d1..6b416c40 100644 --- a/shared/static/wasm/sx/boot.sx +++ b/shared/static/wasm/sx/boot.sx @@ -332,13 +332,14 @@ (component-params comp)) (let ((cursor (dict "parent" el "index" 0))) - (scope-push! "sx-hydrating" cursor) + (host-call el "replaceChildren") + (scope-push! "sx-hydrating" nil) (cek-try (fn () (with-island-scope (fn (disposable) (append! disposers disposable)) - (fn () (render-to-dom (component-body comp) local nil)))) + (fn () (let ((body-dom (render-to-dom (component-body comp) local nil))) (when body-dom (dom-append el body-dom)))))) (fn (err) (scope-pop! "sx-hydrating") diff --git a/web/boot.sx b/web/boot.sx index a5b319d1..6b416c40 100644 --- a/web/boot.sx +++ b/web/boot.sx @@ -332,13 +332,14 @@ (component-params comp)) (let ((cursor (dict "parent" el "index" 0))) - (scope-push! "sx-hydrating" cursor) + (host-call el "replaceChildren") + (scope-push! "sx-hydrating" nil) (cek-try (fn () (with-island-scope (fn (disposable) (append! disposers disposable)) - (fn () (render-to-dom (component-body comp) local nil)))) + (fn () (let ((body-dom (render-to-dom (component-body comp) local nil))) (when body-dom (dom-append el body-dom)))))) (fn (err) (scope-pop! "sx-hydrating")