Can I catch React errors using window.onerror?

Viewed 414

We are working on adding React to a legacy app that uses window.onerror to report errors to our log system. But we've noticed that the errors produced inside React are not catched there... Is this true? If it is, why?

I know we can use componentDidCatch to control React errors, is what we are using now instead of window.onerror but I'm still curious about why window.onerror does not work...

0 Answers
Related