2

I am trying to look for some predefined hooks that could be used for Error Boundary for my React Application. I don't want to use any external library support, so is there any way out for that since useEffect does not replace componentDidCatch.

1 Answer 1

4

It's not yet possible to create Error Boundary components with hooks: https://reactjs.org/docs/hooks-faq.html#do-hooks-cover-all-use-cases-for-classes.

You'll have to write your Error Boundary component using an old-fashioned class component.

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.