I use the react-error-boundary library, is there no way to make a global error component in it, so that when any component breaks, an error component is substituted instead, while IT is IMPORTANT that the application continues its work, only the broken component is replaced. Maybe you should use another library for this?
The main thing is not to wrap each component in error boundary, but the entire application and the problem area itself should be wrapped in error boundary.
I will be glad of any help.
This code is not suitable for the solution:
export const App = withErrorBoundary(() => (
<div className="maincontainer">
<Provider store={store}>
<Router history={routerHistory}>
<Localization>
<Navigation />
</Localization>
</Router>
</Provider>
</div>
), {
onError: (...params) => {
console.log("params", params)
},
FallbackComponent: ErrorBoundary
})
user26486954 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.