fix can go back hydration (#4209)

This commit is contained in:
Evan Almloff authored and GitHub committed 2025-06-18 16:48:59 -07:00
1 parent a0ab159c01
commit 315854b449
10 files changed
+190 -8

No files matched your search

+13 -3
View File
@@ -357,9 +357,6 @@ impl LaunchBuilder {
.hydrate(true);
let mut vdom = dioxus_core::VirtualDom::new(app);
for context in contexts {
vdom.insert_any_root_context(context());
}
#[cfg(feature = "document")]
{
@@ -369,6 +366,19 @@ impl LaunchBuilder {
vdom.provide_root_context(document);
}
#[cfg(feature = "document")]
{
use dioxus_fullstack::FullstackHistory;
let history =
std::rc::Rc::new(FullstackHistory::new(dioxus_web::WebHistory::default()))
as std::rc::Rc<dyn crate::prelude::History>;
vdom.provide_root_context(history);
}
for context in contexts {
vdom.insert_any_root_context(context());
}
return dioxus_web::launch::launch_virtual_dom(vdom, platform_config);
}