Skip to content

Error handling via ErrorBoundary causing infinite loops #6160

Answered by TkDodo
guhadebasish1 asked this question in Q&A
Discussion options

You must be logged in to vote

error boundaries usually don't render children - they render an error instead of the children, until the user confirms the error (e.g. with a button), at which point they re-mount the children to try rendering again.

Imagine if there's a runtime error in children. If the boundary catches it and then renders children again, it would also fail again, thus looping infinitely....

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@guhadebasish1
Comment options

@TkDodo
Comment options

Answer selected by guhadebasish1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants