File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
packages/next/src/server/app-render Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -420,11 +420,11 @@ async function createComponentTreeInternal(
420
420
? process . env . __NEXT_EDGE_PROJECT_DIR
421
421
: ctx . renderOpts . dir ) || ''
422
422
423
- // Use the same condition to render metadataOutlet as metadata
424
- const metadataOutlet = StreamingMetadataOutlet ? (
425
- < StreamingMetadataOutlet />
426
- ) : (
427
- < MetadataOutlet ready = { getMetadataReady } />
423
+ const metadataOutlet = (
424
+ < MetadataOutlet
425
+ ready = { getMetadataReady }
426
+ StreamingComponent = { StreamingMetadataOutlet }
427
+ />
428
428
)
429
429
430
430
const [ notFoundElement , notFoundFilePath ] =
@@ -1014,9 +1014,15 @@ async function createComponentTreeInternal(
1014
1014
1015
1015
async function MetadataOutlet ( {
1016
1016
ready,
1017
+ StreamingComponent,
1017
1018
} : {
1018
1019
ready : ( ) => Promise < void > & { status ?: string ; value ?: unknown }
1020
+ StreamingComponent ?: React . ComponentType | null
1019
1021
} ) {
1022
+ if ( StreamingComponent ) {
1023
+ return < StreamingComponent />
1024
+ }
1025
+
1020
1026
const r = ready ( )
1021
1027
// We can avoid a extra microtask by unwrapping the instrumented promise directly if available.
1022
1028
if ( r . status === 'rejected' ) {
You can’t perform that action at this time.
0 commit comments