Adding error fallback for sections
ErrorFallback
that takes an object with the error
property.
The error
property holds the error object that was thrown by the component.
The pre-requisites to make your component work is having the following
dependencies in versions higher or equal than below:
ProductShelf.tsx
)ErrorFallback
, the function should accept an object
with the error
property.ProductShelf
, the ErrorFallback
component will be rendered instead.
Remember to always use error fallbacks judiciously and only wrap the components
that are prone to errors. Using error boundaries effectively can greatly improve
the stability and user experience of your applications. If no error fallback is
set, a default fallback will be rendered instead