loadable
Used to create Loadable component
Usage
Function Signature
Input
loadFn
Used to load component.
options.resolveComponent
Type: (module: Module, props: Props) => React.ComponentType<Props>
module is the component returned by loadFn, and props is the props parameter accepted by the component.
By default, we think that the default export of file is a react component, so we can render the component directly. But when the component is named export, or we need to dynamically determine which component needs to be rendered according to the props, we can use resolveComponent. Here is an example:
component.js
loadable.js
options.fallback
Whether to display fallback content during loading.
options.ssr
Whether to support SSR, the default value is true.