Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error boundaries #7

Open
aleclarson opened this issue May 20, 2023 · 0 comments
Open

Error boundaries #7

aleclarson opened this issue May 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@aleclarson
Copy link
Contributor

aleclarson commented May 20, 2023

Objective: Add the ability to capture component rendering errors higher up in the component tree and provide a fallback component (i.e. an user-facing error screen).

Proposed solution: Add an <ErrorBoundary> component that sets a fallback property on itself. When a descendant throws an error while rendering, it can search up the component tree until a component with a fallback property is found. If none is found, the descendant will instead render nothing (and its hook memory will be dropped?).

Additional details

  • An error boundary is not required to have a fallback. If none is provided, the error boundary defaults to replacing its children with nothing when a descendant throws an error.
@aleclarson aleclarson added the enhancement New feature or request label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant