From ae934bf75a2d9a2031e4d0fd2d3bb1eef8ac73b5 Mon Sep 17 00:00:00 2001 From: arctic_hen7 Date: Sun, 4 Sep 2022 16:27:23 +1000 Subject: [PATCH] fix: fixed non-hydration rendering It was duplicating the entire page... --- packages/perseus/src/client.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/perseus/src/client.rs b/packages/perseus/src/client.rs index 753f947fab..c4578db0e1 100644 --- a/packages/perseus/src/client.rs +++ b/packages/perseus/src/client.rs @@ -63,7 +63,12 @@ pub fn run_client( #[cfg(feature = "hydrate")] sycamore::hydrate_to(move |cx| perseus_router(cx, router_props), &root); #[cfg(not(feature = "hydrate"))] - sycamore::render_to(move |cx| perseus_router(cx, router_props), &root); + { + // We have to delete the existing content before we can render the new stuff + // (which should be the same) + root.set_inner_html(""); + sycamore::render_to(move |cx| perseus_router(cx, router_props), &root); + } Ok(()) }