🎿

ErrorBoundary

Now when our react app is in production and suppose if any error happens( it can be a http error , or data fetching error, or server side error) Then
we have to deal with it
Now we can’t deal the individual error in every component when it is scaled site
so we use the errorBoundaries to handle this type of error
πŸ”₯
we can use only Class Based component to make error Boundary
Now create one more component called ErrorBoundary
It will be a Wrapping element which is used to detect the error thrown by its child component and deal with it
we use the method call componentDidCatch( ) which is by default catches the error and do the job which you want to handle
notion image