Function dioxus_web::launch_with_props
source · pub fn launch_with_props<T: 'static>(
root_component: fn(_: Scope<'_, T>) -> Element<'_>,
root_properties: T,
config: Config
)
Expand description
Launches the VirtualDOM from the specified component function and props.
This method will block the thread with spawn_local
Example
ⓘ
fn main() {
dioxus_web::launch_with_props(
App,
RootProps { name: String::from("joe") },
Config::new()
);
}
#[derive(ParitalEq, Props)]
struct RootProps {
name: String
}
static App: Component<RootProps> = |cx| {
render!(div {"hello {cx.props.name}"})
}