Function dioxus_web::launch_with_props [−][src]
pub fn launch_with_props<T, F>(
root_component: Component<T>,
root_properties: T,
configuration_builder: F
) where
T: Send + 'static,
F: FnOnce(WebConfig) -> WebConfig, 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") });
}
#[derive(ParitalEq, Props)]
struct RootProps {
name: String
}
static App: Component<RootProps> = |cx| {
rsx!(cx, div {"hello {cx.props.name}"})
}