Skip to main content

Module: Helpers

Pure functions and helpers with useful functionality

Helpers

lazier

lazier<T>(importFactory, importName): LazyExoticComponent<T>

Summary

A function that modifies react lazy to allow for named exports

Example

const ExampleUI = lazier(() => import('./exampleui/ExampleUI'), 'ExampleUI');

Type parameters

NameType
Textends ComponentType<any>

Parameters

NameTypeDescription
importFactory() => Promise<{ [name: string]: T; }>a callback that imports e.g. () => import('./exampleui/ExampleUI')
importNamestringthe named export you want to import.

Returns

LazyExoticComponent<T>

Defined in

src/helpers/lazier.ts:18