react-code-dataset
/
next.js
/crates
/next-custom-transforms
/tests
/fixture
/next-dynamic
/with-options
/output-prod.js
| import dynamic from 'next/dynamic'; | |
| const DynamicComponentWithCustomLoading = dynamic(()=>import('../components/hello') | |
| , { | |
| loadableGenerated: { | |
| webpack: ()=>[ | |
| require.resolveWeak("../components/hello") | |
| ] | |
| }, | |
| loading: ()=><p >...</p> | |
| }); | |
| const DynamicClientOnlyComponent = dynamic(()=>import('../components/hello') | |
| , { | |
| loadableGenerated: { | |
| webpack: ()=>[ | |
| require.resolveWeak("../components/hello") | |
| ] | |
| }, | |
| ssr: false | |
| }); | |
| const DynamicClientOnlyComponentWithSuspense = dynamic(()=>import('../components/hello') | |
| , { | |
| loadableGenerated: { | |
| webpack: ()=>[ | |
| require.resolveWeak("../components/hello") | |
| ] | |
| }, | |
| ssr: false, | |
| suspense: true | |
| }); | |