@@ -34,7 +34,7 @@ export type LoadableBaseOptions<P = {}> = LoadableGeneratedOptions & {
3434 | React . LazyExoticComponent < React . ComponentType < P > >
3535 loadableGenerated ?: LoadableGeneratedOptions
3636 ssr ?: boolean
37- suspense ?: boolean
37+ unstable_suspense ?: boolean
3838}
3939
4040export type LoadableOptions < P = { } > = LoadableBaseOptions < P >
@@ -115,25 +115,25 @@ export default function dynamic<P = {}>(
115115 if ( ! process . env . __NEXT_REACT_ROOT ) {
116116 if (
117117 process . env . NODE_ENV !== 'production' &&
118- loadableOptions . suspense &&
118+ loadableOptions . unstable_suspense &&
119119 ! isServerSide
120120 ) {
121121 console . warn (
122122 `Enable experimental.reactRoot or use React version above 18 to use suspense option`
123123 )
124124 }
125- loadableOptions . suspense = false
125+ loadableOptions . unstable_suspense = false
126126 }
127127
128- const { suspense , loader } = loadableOptions
129- // If suspense is enabled, delegate rendering to suspense
130- if ( suspense ) {
128+ const { unstable_suspense , loader } = loadableOptions
129+ // If unstable_suspense is enabled, delegate rendering to unstable_suspense
130+ if ( unstable_suspense ) {
131131 delete loadableOptions . loadableGenerated
132132 delete loadableOptions . loading
133133 delete loadableOptions . ssr
134134 }
135135
136- if ( typeof loadableOptions . loader === 'function' && suspense ) {
136+ if ( typeof loadableOptions . loader === 'function' && unstable_suspense ) {
137137 loadableOptions . loader = React . lazy (
138138 loader as ( ) => Promise < {
139139 default : React . ComponentType < P >
@@ -150,7 +150,7 @@ export default function dynamic<P = {}>(
150150 }
151151
152152 // support for disabling server side rendering, eg: dynamic(import('../hello-world'), {ssr: false})
153- if ( loadableOptions . ssr === false && ! suspense ) {
153+ if ( loadableOptions . ssr === false && ! unstable_suspense ) {
154154 return noSSR ( loadableFn , loadableOptions )
155155 }
156156
0 commit comments