use new docs
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
import { lazy } from "react"
|
||||
|
||||
export function lazyNamed<
|
||||
Key extends string,
|
||||
Component extends React.ComponentType,
|
||||
>(key: Key, loadModule: () => Promise<Record<Key, Component>>) {
|
||||
return lazy<Component>(async () => {
|
||||
const mod = await loadModule()
|
||||
return { default: mod[key] }
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user