Do You Use Error Boundaries in React?
— react, error-handling, best-practices, react-error-boundary
The post was originally written for the Telegram channel.
You can say that your code does not crash, but from experience I will say that it happened that the client had some kind of extension installed that crashed the inputs and thanks to Error Boundary, not the entire application crashed, but some small part of it with the ability to re-render the UI block.
In different projects I noticed that either Error Boundaries are not used at all, or one global boundary is hung, which still crashes the entire application, sometimes without the ability to restore applications without refreshing the page.
And I just came across a good article that explains the work of Error Boundary and how to arrange them correctly + recommends a rather interesting package, which will do everything for you under the hood, enjoy it.