Skip to content

Commit 4fb4573

Browse files
committed
Minor refactor
1 parent a95d561 commit 4fb4573

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/react-router/lib/router/router.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,19 +3448,17 @@ export function createRouter(init: RouterInit): Router {
34483448
true,
34493449
);
34503450

3451-
// If we matched deeper into the same branch of partialMatches we were
3452-
// already checking, we want to make another pass through
3453-
// patchRoutesOnNavigation()
3454-
if (
3451+
// If we matched deeper into the same branch of `partialMatches` we were already
3452+
// checking, we want to make another pass through `patchRoutesOnNavigation()`
3453+
let matchedDeeper =
34553454
newPartialMatches &&
34563455
partialMatches.length < newPartialMatches.length &&
34573456
compareMatches(
34583457
partialMatches,
34593458
newPartialMatches.slice(0, partialMatches.length),
3460-
)
3461-
) {
3462-
// No-op - fall through and call patchRoutesOnNavigation again
3463-
} else {
3459+
);
3460+
3461+
if (!matchedDeeper) {
34643462
// Otherwise, use the dynamic matches
34653463
return { type: "success", matches: newMatches };
34663464
}

0 commit comments

Comments
 (0)