SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Function lazyComponent

    • Like React.lazy, but a module that fails to load is not a permanent failure.

      Type Parameters

      • C extends ComponentType<any>

      Parameters

      • loader: () => Promise<{ default: C }>

        Loads a module whose default export is the component.

      • Optionaloptions: LazyComponentOptions<ComponentProps<C>>

        How a failure is rendered.

      Returns FC<ComponentProps<C>>

      A mounted instance keeps showing the failure until useLazyRetry is called. A new mount after a failure loads the module again. Render inside a Suspense boundary, as with React.lazy.

      const CustomColorPanel = lazyComponent(() => import('./CustomColorPanel'), {
      renderError: (error) => <LoadError error={error} />
      });