Closed slim-hmidi closed 3 years ago
Hi @slim-hmidi,
Think of ErrorBoundaries like you think of try/catch
. If you put a single try/catch around your whole app, how useful is that with regard to the usefulness of the error message and recovery? Not very. But if you put try/catches around specific areas of your app then you can provide much more useful error messages and recover from errors much more easily.
I talk about this in https://EpicReact.Dev :) Good luck!
@kentcdodds thanks a lot for this answer. The idea of try/catch
makes things more clear for me.
Thanks for youyr time and advice ;)
Hi, I saw once a video on youtube that you fix an issue on react-error-boundry and I see on your project bookshelf that you use it inside authenticated-app.js. I'm used to add the
ErrorBoundry
component code from the react documentation and wrap the main component of my app with it. What do you think about that? or do you recommend to add it around some specific components or any components that you use in the app or the container components in the project?