hasError property
Whether a component within the tree that the ErrorBoundary is wrapping around threw an error.
-
When
true
, and ErrorBoundaryProps.fallbackUIRenderer is set, the return value of that callback will be rendered instead. -
When
true
, and ErrorBoundaryProps.fallbackUIRenderer is not set, the ErrorBoundary will re-mount the tree to attempt to automatically recover from the error.If an identical error is thrown from an identical component within the tree consecutively more frequently than ErrorBoundaryProps.identicalErrorFrequencyTolerance, a static copy of the render tree's HTML that was captured at the time of the error will be rendered. See: ErrorBoundaryProps.onComponentIsUnrecoverable for more information about this scenario.
Implementation
@override
bool get hasError =>
(state[_$key__hasError__ErrorBoundaryState] ?? null) as bool;
Whether a component within the tree that the ErrorBoundary is wrapping around threw an error.
-
When
true
, and ErrorBoundaryProps.fallbackUIRenderer is set, the return value of that callback will be rendered instead. -
When
true
, and ErrorBoundaryProps.fallbackUIRenderer is not set, the ErrorBoundary will re-mount the tree to attempt to automatically recover from the error.If an identical error is thrown from an identical component within the tree consecutively more frequently than ErrorBoundaryProps.identicalErrorFrequencyTolerance, a static copy of the render tree's HTML that was captured at the time of the error will be rendered. See: ErrorBoundaryProps.onComponentIsUnrecoverable for more information about this scenario.
Implementation
@override
set hasError(bool value) =>
state[_$key__hasError__ErrorBoundaryState] = value;