-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
ErrorBoundary useless with React 16.4 handling of getDerivedStateFromProps #4708
Comments
I'm sure it's because of this: https://reactjs.org/blog/2018/05/23/react-v-16-4.html#bugfix-for-getderivedstatefromprops |
@timneutkens I can try to pick this up. What's the desired behavior that the |
@vitorbal there's no need to do fix this anymore, I've rewritten most of the logic involving the error overlay in my webpack 4 PR, the development error overlay is now handled by Thank you very much for wanting to help though, very much appreciated, there's quite a few other "good first issue" / "help wanted" issues which we'd love help on 🙏❤️ |
Bug report
Describe the bug
With the new handling of
getDerivedStateFromProps
, the ErrorBoundary's state is constantly reset (error tonull
) before every render. Therefore it is never able to render theErrorReporter
and instead attempts to rerender the faulty Page/react components.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
yarn && yarn dev
about
pageExpected behavior
Expect the ErrorBoundary to render
next/_error.js
with the associated error and stacktrace.Screenshots
If applicable, add screenshots to help explain your problem.
System information
OS: [e.g. macOS, Windows]BrowserAdditional context
If you revert to 16.3.2 this is not an issue.
getDerivedStateFromProps
does not get called before the re-render, leavingstate.error
intact.The text was updated successfully, but these errors were encountered: