Next
Error boundaries are elements that capture JavaScript errors anywhere in our app, log those errors, and show a fallback user interface. It doesn't break the entire tree of the app element and only renders the fallback UI when a component mistake occurs.
The advantage of Error boundaries is if we have a simple react app we can declare once and use it for the entire application. In the case of complex applications where we have multiple components, we can declare multiple error boundaries to recover each section of the application.