-
-
Notifications
You must be signed in to change notification settings - Fork 861
Open
Labels
Description
Similar to React's <Suspense> (but way less complex), pass a code split component and optionally a custom loader to show while it is being imported.
A simple "just loading" component could be fairly nice for components that don't need to be tightly integrated with the parent, just to avoid a lot of boilerplate loading indicators and stuff. Not necessarily as complicated as the Suspense as that goes deep in the children, but just for a single component.
Something like this (might make sense to do it some other way, but you get the idea)
<LazyComponent
content={import('...')}>
This text is shown while loading
</LazyComponent>I could see this also being useful perhaps to just show a LoadingIndicator when the param loading is true, maybe. But that's not the focus.
luceos and linkerlin