An open API service indexing awesome lists of open source software.

https://github.com/kevin940726/next-dynamic-loading-props

Pass props to the loading components in next/dynamic
https://github.com/kevin940726/next-dynamic-loading-props

dynamic lazy loadable next nextjs react

Last synced: 10 months ago
JSON representation

Pass props to the loading components in next/dynamic

Awesome Lists containing this project

README

          

# next-dynamic-loading-props
Pass props to the loading components in next/dynamic. A package to workaround [vercel/next.js#7906](https://github.com/vercel/next.js/issues/7906).

## Installation

```sh
npm install next-dynamic-loading-props
```

## Usage

```jsx
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
}
}
));

```