Skip to content

Commit 6ab2bc1

Browse files
committed
reset ssr-client
1 parent 0f0762e commit 6ab2bc1

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

packages/router-core/src/ssr/ssr-client.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)