cytoplasmic
    Preparing search index...

    Function Lazy

    • Use this component for lazy importing other components.

      Parameters

      • props: {
            children: () => Promise<ElementChildren>;
            else?: ElementChildren;
            onError?: (error: any) => void;
        }
        • children: () => Promise<ElementChildren>

          Async function for that resolves to an element.

        • Optionalelse?: ElementChildren

          Element to show until the promise resolves.

        • OptionalonError?: (error: any) => void

          Error handler which is executed if the promise is rejected.

      Returns Element

      <Lazy else='loading...'>{() => import('./my-component').then(m => <m.MyComponent/>)}</Lazy>