From 45b787750022d16a4b9419fc3a3af9fdb6e77ca0 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Sat, 10 Aug 2024 13:43:08 +0800 Subject: [PATCH] fix: ConfigProvider on_cleanup --- examples/ssr_axum/Cargo.toml | 13 +++++-------- thaw/src/config_provider/mod.rs | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/ssr_axum/Cargo.toml b/examples/ssr_axum/Cargo.toml index a9b0493..59d6239 100644 --- a/examples/ssr_axum/Cargo.toml +++ b/examples/ssr_axum/Cargo.toml @@ -9,10 +9,10 @@ crate-type = ["cdylib", "rlib"] [dependencies] axum = { version = "0.7.4", optional = true } console_error_panic_hook = "0.1" -leptos = { version = "0.7.0-beta" } -leptos_axum = { version = "0.7.0-beta", optional = true } -leptos_meta = { version = "0.7.0-beta" } -leptos_router = { version = "0.7.0-beta" } +leptos = { git = "https://github.com/leptos-rs/leptos", rev = "867036559489e86c1f25cdf7133d803d88b0579b" } +leptos_axum = { git = "https://github.com/leptos-rs/leptos", rev = "867036559489e86c1f25cdf7133d803d88b0579b", optional = true } +leptos_meta = { git = "https://github.com/leptos-rs/leptos", rev = "867036559489e86c1f25cdf7133d803d88b0579b" } +leptos_router = { git = "https://github.com/leptos-rs/leptos", rev = "867036559489e86c1f25cdf7133d803d88b0579b" } tokio = { version = "1", features = ["rt-multi-thread"], optional = true } tower = { version = "0.4", optional = true } tower-http = { version = "0.5", features = ["fs"], optional = true } @@ -25,10 +25,7 @@ log = "0.4" demo = { path = "../../demo", default-features = false } [features] -hydrate = [ - "leptos/hydrate", - "demo/hydrate", -] +hydrate = ["leptos/hydrate", "demo/hydrate"] ssr = [ "dep:axum", "dep:tokio", diff --git a/thaw/src/config_provider/mod.rs b/thaw/src/config_provider/mod.rs index de0cab5..6ae0685 100644 --- a/thaw/src/config_provider/mod.rs +++ b/thaw/src/config_provider/mod.rs @@ -30,7 +30,8 @@ pub fn ConfigProvider( ) }); - on_cleanup(move || { + #[cfg(not(feature = "ssr"))] + Owner::on_cleanup(move || { if let Ok(Some(style)) = document().query_selector(&format!("head style[data-thaw-id=\"{}\"]", id.get_value())) {