3

I have a React application which is not created with create-react-app. I would like to add a error handling functionality but I have no idea how:

When there is an error, instead of getting a blank page and errors in console, in development, how do I enable this functionality in a React application where it shows the error stack in the browser?

Do I have to write the code for it or there is a react configuration that I can just enable or should I use a library to achieve this?

React application, error stack in browser

EDIT:

Above image is what I want to see as an error report in my browser when there is an error. It is not an error I am trying to solve.

2

1 Answer 1

1

Try Error Boundaries . Add those in your Root Level to catch all errors inside that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.