mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-14 00:17:17 +00:00
25 lines
418 B
Rust
25 lines
418 B
Rust
use dioxus::{core::CapturedError, prelude::*};
|
|
|
|
fn main() {
|
|
dioxus_desktop::launch(app);
|
|
}
|
|
|
|
fn app() -> Element {
|
|
rsx! {
|
|
ErrorBoundary {
|
|
handle_error: |error: CapturedError| rsx! {"Found error {error}"},
|
|
DemoC { x: 1 }
|
|
}
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
fn DemoC(x: i32) -> Element {
|
|
let result = Err("Error");
|
|
|
|
result.throw()?;
|
|
|
|
render! {
|
|
h1 { "{x}" }
|
|
}
|
|
}
|