File tree 1 file changed +7
-4
lines changed
packages/react-router/lib/router
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -3623,12 +3623,12 @@ export function createStaticHandler(
3623
3623
// We never even got to the handlers, so we've got no data -
3624
3624
// just create an empty context reflecting the error.
3625
3625
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
3626
3629
let boundaryRouteId = skipLoaderErrorBubbling
3627
3630
? 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 (
3632
3632
matches ,
3633
3633
matches . find (
3634
3634
( m ) => m . route . id === routeId || m . route . loader
@@ -6039,6 +6039,9 @@ function processRouteLoaderData(
6039
6039
if ( skipLoaderErrorBubbling ) {
6040
6040
errors [ id ] = error ;
6041
6041
} 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
6042
6045
let boundaryMatch = findNearestBoundary ( matches , id ) ;
6043
6046
if ( errors [ boundaryMatch . route . id ] == null ) {
6044
6047
errors [ boundaryMatch . route . id ] = error ;
You can’t perform that action at this time.
0 commit comments