can you catch all errors of a React.js app with a try/catch block?
Edit The below solution catches only render errors because they are sync in nature. That is how JS works, it has nothing to do with React, which is what the OP asked about. Original post React 16 introduced Error Boundaries and the componentDidCatch lifecycle method: class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = … Read more