-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers
Description
I used the example with-sentry But it put the page in infinite loop when an error occured.
The problem is in getDerivedStateFromError method.
static getDerivedStateFromError() {
// React Error Boundary here allows us to set state flagging the error (and
// later render a fallback UI).
return { hasError: true }
}
After each error, getDerivedStateFromError is setting hasError to true and makes the component re-render!
Is this even a bug?
BlakeBrown
Metadata
Metadata
Assignees
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers