Skip to content

Commit

Permalink
Remove parentRendered argument
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 committed Dec 13, 2024
1 parent af1b74f commit a4c1e0c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export async function walkTreeWithFlightRouterState({
loaderTreeToFilter,
parentParams,
flightRouterState,
parentRendered,
rscPayloadHead,
injectedCSS,
injectedJS,
Expand All @@ -42,7 +41,6 @@ export async function walkTreeWithFlightRouterState({
loaderTreeToFilter: LoaderTree
parentParams: { [key: string]: string | string[] }
flightRouterState?: FlightRouterState
parentRendered?: boolean
rscPayloadHead: React.ReactNode
injectedCSS: Set<string>
injectedJS: Set<string>
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -215,7 +213,6 @@ export async function walkTreeWithFlightRouterState({
parentParams: currentParams,
flightRouterState:
flightRouterState && flightRouterState[1][parallelRouteKey],
parentRendered: parentRendered || renderComponentsOnThisLevel,
rscPayloadHead,
injectedCSS: injectedCSSWithCurrentLayout,
injectedJS: injectedJSWithCurrentLayout,
Expand Down

0 comments on commit a4c1e0c

Please sign in to comment.