-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
In the second example "Resetting the error boundary"
Why does handle_error closure not allow any mutation as I would like the reset (errors: ErrorContext [errors.clear_errors()]) to be handled outside the ErrorBoundary.
fn App() -> Element {
let mut multiplier = use_signal(|| String::new());
let mut rst: Signal<Option<ErrorContext>> = use_signal(|| None);
rsx! {
input {
r#type: "text",
value: multiplier,
oninput: move |e| multiplier.set(e.value())
}
ErrorBoundary {
handle_error: |errors: ErrorContext| {
multiplier.set("mutate".to_string()); // Not allowed
rst.set(Some(errors.clone())); // Not allowed, to be reset by external
rsx! {
div {
"Oops, we encountered an error. Please report {errors:?} to the developer of this application"
}
}
},
Counter {
multiplier
}
}
}
}
https://docs.rs/dioxus/latest/dioxus/prelude/fn.ErrorBoundary.html
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels