Skip to content

Commit

Permalink
Check parallel routes for child name
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannes Bornö committed Sep 30, 2022
1 parent 85d8dff commit 2a1e73c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/next/server/app-render.tsx
Expand Up @@ -6,7 +6,7 @@ import type { ServerRuntime } from '../types'
// @ts-ignore
import React, { experimental_use as use } from 'react'

import { ParsedUrlQuery } from 'querystring'
import { ParsedUrlQuery, stringify as stringifyQuery } from 'querystring'
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack'
import { NextParsedUrlQuery } from './request-meta'
import RenderResult from './render-result'
Expand Down Expand Up @@ -610,8 +610,7 @@ function getRootLayoutPath(
rootLayoutPath += `${segment}/`
const isLayout = typeof layout !== 'undefined'
if (isLayout) return rootLayoutPath
// Will never be anything else than `children`, parallel routes layout will have already been found
const child = parallelRoutes.children
const child = Object.values(parallelRoutes)[0]
if (!child) return
return getRootLayoutPath(child, rootLayoutPath)
}
Expand All @@ -627,7 +626,7 @@ function findRootLayoutInFlightRouterState(
} else if (segments.length > rootLayoutSegments.length) {
return false
}
const child = parallelRoutes.children
const child = Object.values(parallelRoutes)[0]
if (!child) return false
return findRootLayoutInFlightRouterState(child, rootLayoutSegments, segments)
}
Expand Down

0 comments on commit 2a1e73c

Please sign in to comment.