Skip to main content

ErrorBoundary

Function ErrorBoundary 

Source
pub fn ErrorBoundary(
    fallback: impl Fn(ErrorInfo, Rc<dyn Fn()>) -> View + 'static,
    content: impl Fn() -> View + 'static,
) -> View
Expand description

Render fallback when content panics (native) or calls throw_boundary, and stay in fallback until reset() runs. fallback(info, reset) receives the error and a closure that clears the error and re-enters content.

Prefer Result-style / throw_boundary over panic! on WASM targets.