next-dynamic-loading-props
v0.1.1
Published
Pass props to the loading components in next/dynamic
Downloads
3,709
Maintainers
Readme
next-dynamic-loading-props
Pass props to the loading components in next/dynamic
Installation
npm install next-dynamic-loading-props
Usage
import dynamic from 'next/dynamic';
import withLoadingProps from 'next-dynamic-loading-props';
const Modal = withLoadingProps(useLoadingProps => dynamic(
() => import('./modal'),
{
ssr: false,
loading: () => {
const props = useLoadingProps();
return <Loading {...props} />
}
}
));
<Modal {...loadingProps} />