diff --git a/packages/web/examples/hello.rs b/packages/web/examples/hello.rs index acc9f5ff4..e87dcb358 100644 --- a/packages/web/examples/hello.rs +++ b/packages/web/examples/hello.rs @@ -2,8 +2,6 @@ use dioxus_core::prelude::*; use dioxus_web::WebsysRenderer; fn main() { - // todo: set this up so the websys render can spawn itself rather than having to wrap it - // almost like bundling an executor with the wasm version wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example)); } diff --git a/packages/web/src/lib.rs b/packages/web/src/lib.rs index bde261993..1375e008e 100644 --- a/packages/web/src/lib.rs +++ b/packages/web/src/lib.rs @@ -25,6 +25,15 @@ pub struct WebsysRenderer { } impl WebsysRenderer { + /// This method is the primary entrypoint for Websys Dioxus apps. Will panic if an error occurs while rendering. + /// See DioxusErrors for more information on how these errors could occour. + /// + /// ```ignore + /// fn main() { + /// wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example)); + /// } + /// ``` + /// /// Run the app to completion, panicing if any error occurs while rendering. /// Pairs well with the wasm_bindgen async handler pub async fn start(root: FC<()>) {