When using React.lazy(), which of the following is a required companion component to handle potential loading states or errors?

  • ErrorBoundary
  • LazyComponent
  • LoaderComponent
  • Suspense
When using React.lazy(), an ErrorBoundary component is a required companion component to handle potential loading states or errors. It acts as a fallback component in case the lazily loaded component fails to load. Suspense is used to wrap the lazy-loaded component, and the LoaderComponent is not a standard requirement.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *