File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
test/integration/react-18/app/pages/suspense Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -134,11 +134,15 @@ export default function dynamic<P = {}>(
134134 ...loadableOptions ,
135135 ...loadableOptions . loadableGenerated ,
136136 }
137+ delete loadableOptions . loadableGenerated
137138 }
138139
139140 // support for disabling server side rendering, eg: dynamic(import('../hello-world'), {ssr: false})
140- if ( loadableOptions . ssr === false ) {
141- return noSSR ( loadableFn , loadableOptions )
141+ if ( typeof loadableOptions . ssr === 'boolean' ) {
142+ if ( ! loadableOptions . ssr ) {
143+ return noSSR ( loadableFn , loadableOptions )
144+ }
145+ delete loadableOptions . ssr
142146 }
143147
144148 return loadableFn ( loadableOptions )
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import dynamic from 'next/dynamic'
33
44const Bar = dynamic ( ( ) => import ( '../../components/bar' ) , {
55 suspense : true ,
6+ // Explicitly declare loaded modules.
7+ // For suspense cases, they'll be ignored.
8+ // For loadable component cases, they'll be handled
69 loadableGenerated : {
710 modules : [ '../../components/bar' ] ,
811 webpack : [ require . resolveWeak ( '../../components/bar' ) ] ,
You can’t perform that action at this time.
0 commit comments