fix hydration
This commit is contained in:
1 parent
d20422bb0f
commit
694bef0d93
8 files changed
+76
-21
No files matched your search
@@ -12,11 +12,18 @@ pub fn launch(
|
||||
contexts: Vec<Box<dyn Fn() -> Box<dyn Any>>>,
|
||||
platform_config: Config,
|
||||
) {
|
||||
let mut vdom = VirtualDom::new(root);
|
||||
for context in contexts {
|
||||
vdom.insert_any_root_context(context());
|
||||
}
|
||||
launch_virtual_dom(vdom, platform_config);
|
||||
}
|
||||
|
||||
/// Launch the web application with a prebuild virtual dom
|
||||
///
|
||||
/// For a builder API, see `LaunchBuilder` defined in the `dioxus` crate.
|
||||
pub fn launch_virtual_dom(vdom: VirtualDom, platform_config: Config) {
|
||||
wasm_bindgen_futures::spawn_local(async move {
|
||||
let mut vdom = VirtualDom::new(root);
|
||||
for context in contexts {
|
||||
vdom.insert_any_root_context(context());
|
||||
}
|
||||
crate::run(vdom, platform_config).await;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user