From a4c1e0ce81421e97c9b82bfca806fc42a0b0442b Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 13 Dec 2024 00:11:35 -0500 Subject: [PATCH] Remove parentRendered argument It doesn't look like this argument is logically needed. No callers pass it as an option except for the recursive call, and the recursive call will never set it to `true` because of the `renderComponentsOnThisLevel` branch that happens earlier in the function. I'm guessing it was needed at one point but then the logic changed. --- .../server/app-render/walk-tree-with-flight-router-state.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx b/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx index c4fa66727ab1e4..85de6b7d57e69e 100644 --- a/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx +++ b/packages/next/src/server/app-render/walk-tree-with-flight-router-state.tsx @@ -29,7 +29,6 @@ export async function walkTreeWithFlightRouterState({ loaderTreeToFilter, parentParams, flightRouterState, - parentRendered, rscPayloadHead, injectedCSS, injectedJS, @@ -42,7 +41,6 @@ export async function walkTreeWithFlightRouterState({ loaderTreeToFilter: LoaderTree parentParams: { [key: string]: string | string[] } flightRouterState?: FlightRouterState - parentRendered?: boolean rscPayloadHead: React.ReactNode injectedCSS: Set injectedJS: Set @@ -119,7 +117,7 @@ export async function walkTreeWithFlightRouterState({ !Boolean(modules.loading) && !hasLoadingComponentInTree(loaderTreeToFilter))) - if (!parentRendered && renderComponentsOnThisLevel) { + if (renderComponentsOnThisLevel) { const overriddenSegment = flightRouterState && canSegmentBeOverridden(actualSegment, flightRouterState[0]) @@ -215,7 +213,6 @@ export async function walkTreeWithFlightRouterState({ parentParams: currentParams, flightRouterState: flightRouterState && flightRouterState[1][parallelRouteKey], - parentRendered: parentRendered || renderComponentsOnThisLevel, rscPayloadHead, injectedCSS: injectedCSSWithCurrentLayout, injectedJS: injectedJSWithCurrentLayout,