Fix hydration of link element (#4561)
* Fix hydration of link element * revert some logging changes * clean up fullstack history provider * fix router tests * fix document context type
This commit is contained in:
1 parent
6cd4453662
commit
021565c171
12 files changed
+141
-109
No files matched your search
@@ -347,42 +347,6 @@ impl LaunchBuilder {
|
||||
|
||||
#[cfg(feature = "web")]
|
||||
if matches!(platform, KnownPlatform::Web) {
|
||||
// If the server feature is enabled, launch the client with hydration enabled
|
||||
#[cfg(feature = "fullstack")]
|
||||
{
|
||||
let platform_config = configs
|
||||
.into_iter()
|
||||
.find_map(|cfg| cfg.downcast::<dioxus_web::Config>().ok())
|
||||
.unwrap_or_default()
|
||||
.hydrate(true);
|
||||
|
||||
let mut vdom = dioxus_core::VirtualDom::new(app);
|
||||
|
||||
#[cfg(feature = "document")]
|
||||
{
|
||||
use dioxus_fullstack::FullstackWebDocument;
|
||||
let document = std::rc::Rc::new(FullstackWebDocument)
|
||||
as std::rc::Rc<dyn crate::prelude::document::Document>;
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(not(any(feature = "fullstack")))]
|
||||
return dioxus_web::launch::launch(app, contexts, configs);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user