Skip to content

Commit 766c6e6

Browse files
committed
updates
1 parent b466024 commit 766c6e6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,12 +3623,12 @@ export function createStaticHandler(
36233623
// We never even got to the handlers, so we've got no data -
36243624
// just create an empty context reflecting the error.
36253625

3626+
// Find the boundary at or above the source of the middleware
3627+
// error or the highest loader. We can't render any UI below
3628+
// the highest loader since we have no loader data available
36263629
let boundaryRouteId = skipLoaderErrorBubbling
36273630
? routeId
3628-
: // Find the boundary at or above the source of the middleware
3629-
// error or the highest loader. We can't render any UI below
3630-
// the highest loader since we have no loader data available
3631-
findNearestBoundary(
3631+
: findNearestBoundary(
36323632
matches,
36333633
matches.find(
36343634
(m) => m.route.id === routeId || m.route.loader
@@ -6039,6 +6039,9 @@ function processRouteLoaderData(
60396039
if (skipLoaderErrorBubbling) {
60406040
errors[id] = error;
60416041
} else {
6042+
// Look upwards from the matched route for the closest ancestor error
6043+
// boundary, defaulting to the root match. Prefer higher error values
6044+
// if lower errors bubble to the same boundary
60426045
let boundaryMatch = findNearestBoundary(matches, id);
60436046
if (errors[boundaryMatch.route.id] == null) {
60446047
errors[boundaryMatch.route.id] = error;

0 commit comments

Comments
 (0)