Capturing React Errors Globally
问题 I'm new to React. I want to capture all react uncaught and unexpected errors/warnings and i would like to log the errors to an external api. I know its possible by Try Catch method but I'm planning to have it globally so that other developer need not to write the code each and every time. I tried window.onerror/addEventListener('error', function(e){} which only captures the Javascript errors but not react errors. This is similar to following post How do I handle exceptions?. But the solution