Answer the question
In order to leave comments, you need to log in
How to properly catch errors in react 16.x?
I made a container according to the manual . Wrapped them with the main common components. and now if an error is found in some component, then I display the appropriate message.
In the application, a structure in which some components are located inside others and I wrapped everything in <ErrorBoundary>...</ErrorBoundary>
And I want that if an error is found in a child component, then the error was rendered instead of it, and not instead of the parent component itself, which is wrapped in <ErrorBoundary>...</ErrorBoundary>
Interesting, in In general, can there be a manual somewhere about the emergence of errors in React?
Answer the question
In order to leave comments, you need to log in
Wrap the child component that might throw an error in an ErrorBoundary. There is no special mechanism for raising errors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question