implement launch builder for the desktop and web platforms

This commit is contained in:
Evan Almloff committed 2024-01-16 08:42:16 -06:00
1 parent ef553a2cb2
commit 7e4d2debe0
70 files changed
+448 -431

No files matched your search

+4 -4
View File
@@ -13,15 +13,15 @@ use dioxus::prelude::*;
use dioxus_desktop::Config;
fn main() {
Config::new()
.with_prerendered({
LaunchBuilder::new(app)
.cfg(Config::new().with_prerendered({
// We build the dom a first time, then pre-render it to HTML
let pre_rendered_dom = VirtualDom::prebuilt(app);
// We then launch the app with the pre-rendered HTML
dioxus_ssr::pre_render(&pre_rendered_dom)
})
.launch(app);
}))
.launch();
}
fn app() -> Element {