diff --git a/packages/server/examples/axum-hello-world/src/main.rs b/packages/server/examples/axum-hello-world/src/main.rs index b5553f7a2..5b3323ec4 100644 --- a/packages/server/examples/axum-hello-world/src/main.rs +++ b/packages/server/examples/axum-hello-world/src/main.rs @@ -14,7 +14,7 @@ fn main() { #[cfg(feature = "web")] dioxus_web::launch_with_props( app, - get_props_from_document().unwrap_or_default(), + get_root_props_from_document().unwrap_or_default(), dioxus_web::Config::new().hydrate(true), ); #[cfg(feature = "ssr")] diff --git a/packages/server/examples/salvo-hello-world/src/main.rs b/packages/server/examples/salvo-hello-world/src/main.rs index 15a3ebe31..a6e33dc63 100644 --- a/packages/server/examples/salvo-hello-world/src/main.rs +++ b/packages/server/examples/salvo-hello-world/src/main.rs @@ -14,7 +14,7 @@ fn main() { #[cfg(feature = "web")] dioxus_web::launch_with_props( app, - get_props_from_document().unwrap_or_default(), + get_root_props_from_document().unwrap_or_default(), dioxus_web::Config::new().hydrate(true), ); #[cfg(feature = "ssr")] diff --git a/packages/server/examples/warp-hello-world/src/main.rs b/packages/server/examples/warp-hello-world/src/main.rs index a636dbc58..4929af0c8 100644 --- a/packages/server/examples/warp-hello-world/src/main.rs +++ b/packages/server/examples/warp-hello-world/src/main.rs @@ -14,7 +14,7 @@ fn main() { #[cfg(feature = "web")] dioxus_web::launch_with_props( app, - get_props_from_document().unwrap_or_default(), + get_root_props_from_document().unwrap_or_default(), dioxus_web::Config::new().hydrate(true), ); #[cfg(feature = "ssr")] diff --git a/packages/server/src/lib.rs b/packages/server/src/lib.rs index e9f4ee63f..c5ad196bc 100644 --- a/packages/server/src/lib.rs +++ b/packages/server/src/lib.rs @@ -26,7 +26,7 @@ pub mod prelude { #[cfg(feature = "warp")] pub use crate::adapters::warp_adapter::*; #[cfg(not(feature = "ssr"))] - pub use crate::props_html::deserialize_props::get_props_from_document; + pub use crate::props_html::deserialize_props::get_root_props_from_document; #[cfg(feature = "ssr")] pub use crate::render::SSRState; #[cfg(feature = "ssr")] diff --git a/packages/server/src/props_html/deserialize_props.rs b/packages/server/src/props_html/deserialize_props.rs index 28b206ac5..64f2181ab 100644 --- a/packages/server/src/props_html/deserialize_props.rs +++ b/packages/server/src/props_html/deserialize_props.rs @@ -20,7 +20,9 @@ pub(crate) fn serde_from_string(string: &str) -> Option #[cfg(not(feature = "ssr"))] /// Get the props from the document. This is only available in the browser. -pub fn get_props_from_document() -> Option { +/// +/// When dioxus-server renders the page, it will serialize the root props and put them in the document. This function gets them from the document. +pub fn get_root_props_from_document() -> Option { #[cfg(not(target_arch = "wasm32"))] { None