File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
packages/router-core/src/ssr Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -172,17 +172,8 @@ export async function hydrate(router: AnyRouter): Promise<any> {
172172 router . state . matches . map ( async ( match ) => {
173173 const route = router . looseRoutesById [ match . routeId ] !
174174
175- // Build parent context by accumulating from all ancestors
176- // We read from __beforeLoadContext to avoid issues during transitions
177- let parentContext = router . options . context ?? { }
178- for ( let i = 0 ; i < match . index ; i ++ ) {
179- const ancestorMatch = router . state . matches [ i ] !
180- parentContext = {
181- ...parentContext ,
182- ...ancestorMatch . __routeContext ,
183- ...ancestorMatch . __beforeLoadContext ,
184- }
185- }
175+ const parentMatch = router . state . matches [ match . index - 1 ]
176+ const parentContext = parentMatch ?. context ?? router . options . context
186177
187178 // `context()` was already executed by `matchRoutes`, however route context was not yet fully reconstructed
188179 // so run it again and merge route context
You can’t perform that action at this time.
0 commit comments