Skip to content

Commit

Permalink
Remove parentRendered argument (#73877)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
acdlite authored Dec 17, 2024
1 parent d7d913a commit 5b60c13
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export async function walkTreeWithFlightRouterState({
loaderTreeToFilter,
parentParams,
flightRouterState,
parentRendered,
rscHead,
injectedCSS,
injectedJS,
Expand All @@ -44,7 +43,6 @@ export async function walkTreeWithFlightRouterState({
loaderTreeToFilter: LoaderTree
parentParams: { [key: string]: string | string[] }
flightRouterState?: FlightRouterState
parentRendered?: boolean
rscHead: HeadData
injectedCSS: Set<string>
injectedJS: Set<string>
Expand Down Expand Up @@ -122,7 +120,7 @@ export async function walkTreeWithFlightRouterState({
!Boolean(modules.loading) &&
!hasLoadingComponentInTree(loaderTreeToFilter)))

if (!parentRendered && renderComponentsOnThisLevel) {
if (renderComponentsOnThisLevel) {
const overriddenSegment =
flightRouterState &&
canSegmentBeOverridden(actualSegment, flightRouterState[0])
Expand Down Expand Up @@ -219,7 +217,6 @@ export async function walkTreeWithFlightRouterState({
parentParams: currentParams,
flightRouterState:
flightRouterState && flightRouterState[1][parallelRouteKey],
parentRendered: parentRendered || renderComponentsOnThisLevel,
rscHead,
injectedCSS: injectedCSSWithCurrentLayout,
injectedJS: injectedJSWithCurrentLayout,
Expand Down

0 comments on commit 5b60c13

Please sign in to comment.