Skip to content

Commit 9686ba6

Browse files
committed
Fix Activity boundary names
Follow-up to vercel#85155. Made a mistake in the context-passing logic.
1 parent da024c1 commit 9686ba6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/next/src/client/components/layout-router.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ function InnerLayoutRouter({
348348
}: {
349349
tree: FlightRouterState
350350
segmentPath: FlightSegmentPath
351-
debugNameContext: ActivityProps['name']
351+
debugNameContext: string
352352
cacheNode: CacheNode
353353
params: Params
354354
url: string
@@ -584,7 +584,7 @@ export default function OuterLayoutRouter({
584584
parentParams,
585585
url,
586586
isActive,
587-
debugNameContext: parentDebugNameContext,
587+
debugNameContext,
588588
} = context
589589

590590
// Get the CacheNode for this segment by reading it from the parent segment's
@@ -706,9 +706,9 @@ export default function OuterLayoutRouter({
706706

707707
const debugName = getBoundaryDebugNameFromSegment(segment)
708708
// `debugNameContext` represents the nearest non-"virtual" parent segment.
709-
// `getBoundaryDebugNameFromSegment` returns null for virtual segments.
710-
// So if `debugName` is null, the context is passed through unchanged.
711-
const debugNameContext = debugName ?? parentDebugNameContext
709+
// `getBoundaryDebugNameFromSegment` returns undefined for virtual segments.
710+
// So if `debugName` is undefined, the context is passed through unchanged.
711+
const childDebugNameContext = debugName ?? debugNameContext
712712

713713
// TODO: The loading module data for a segment is stored on the parent, then
714714
// applied to each of that parent segment's parallel route slots. In the
@@ -742,7 +742,7 @@ export default function OuterLayoutRouter({
742742
params={params}
743743
cacheNode={cacheNode}
744744
segmentPath={segmentPath}
745-
debugNameContext={debugNameContext}
745+
debugNameContext={childDebugNameContext}
746746
isActive={isActive && stateKey === activeStateKey}
747747
/>
748748
{segmentBoundaryTriggerNode}

packages/next/src/shared/lib/app-router-context.shared-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const LayoutRouterContext = React.createContext<{
6363
parentCacheNode: CacheNode
6464
parentSegmentPath: FlightSegmentPath | null
6565
parentParams: Params
66-
debugNameContext: string | undefined
66+
debugNameContext: string
6767
url: string
6868
isActive: boolean
6969
} | null>(null)

0 commit comments

Comments
 (0)