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
Unable to catch Error emitted in componentDidMount #14549
Comments
Can I take this? |
it seems that I missed some point and not thought it clearly , please discard this paragraph. |
@yanglin5689446 since when |
@charBap Sure, feel free to investigate! |
oops your are right, I didn't think the scenario clearly, forget what I said. |
The error is not rethrown. You see an error message in the console because React does a special trick to ensure all errors are logged. But the error was successfully handled by an error boundary. |
But how should i catch it? I need to make a tests that will ensure that component thrown an error at |
Sorry, I don't quite understand what you're asking. In either case, that appears to be a question — please use the community resources for help. We use the issue tracker for bug reports. |
Do you want to request a feature or report a bug?
Bug report.
What is the current behavior?
Error boundary handles
Error
emitted incomponentDidMount
and somewhy rethrows it.https://jsfiddle.net/xobotyi/96eqo8zp/
What is the expected behavior?
It should not rethrow the error.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React: 16.7.0
OS: Win 10 x64
Browser: Chromium 71.0.3578
The text was updated successfully, but these errors were encountered: