Function dioxus_mobile::launch_cfg [−][src]
pub fn launch_cfg(
root: fn(Scope<'_, ()>) -> Option<VNode<'_>>,
config_builder: impl for<'b, 'a> FnOnce(&'b mut DesktopConfig<'a>) -> &'b mut DesktopConfig<'a>
)
Expand description
Launch the WebView and run the event loop, with configuration.
This function will start a multithreaded Tokio runtime as well the WebView event loop.
You can configure the WebView window with a configuration closure
use dioxus::prelude::*;
fn main() {
dioxus::desktop::launch_cfg(app, |c| c.with_window(|w| w.with_title("My App")));
}
fn app(cx: Scope) -> Element {
cx.render(rsx!{
h1 {"hello world!"}
})
}