You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have global handler for unhandled errors:
window.addEventListener('error', (evt) => ...)
Now when I use the componentDidCatch function it gets called correctly when render throws an exception but that global error event is also triggered - and before the componentDidCatch call.
What is the expected behavior?
Since componentDidCatch handles the error I'd prefer if the global event wasn't triggered, same as with a usual try-catch block.
Or is there at least some way to figure out from the evt object in the event handler that the exception is caught by react?
I hope this made sense...
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Not sure tbh.
What is the current behavior?
I have global handler for unhandled errors:
window.addEventListener('error', (evt) => ...)
Now when I use the componentDidCatch function it gets called correctly when render throws an exception but that global error event is also triggered - and before the componentDidCatch call.
What is the expected behavior?
Since componentDidCatch handles the error I'd prefer if the global event wasn't triggered, same as with a usual try-catch block.
Or is there at least some way to figure out from the evt object in the event handler that the exception is caught by react?
I hope this made sense...
The text was updated successfully, but these errors were encountered: