UNPKG

cra-template-sdw

Version:
10 lines (7 loc) 240 B
import { lazy as reactLazy } from 'react'; export const lazy = (lazyImport: () => Promise<any>) => { return reactLazy(async () => { const module = await lazyImport(); return { default: module[Object.keys(module)[0]] }; }); };