Skip to content

Commit 58c8720

Browse files
committed
simplify again
1 parent 478b019 commit 58c8720

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,15 @@ export async function hydrate(router: AnyRouter): Promise<any> {
5656
)
5757

5858
const dehydratedRouter = window.$_TSR.router
59-
const { manifest, dehydratedData } = dehydratedRouter
60-
6159
dehydratedRouter.matches.forEach((dehydratedMatch) => {
6260
dehydratedMatch.i = hydrateSsrMatchId(dehydratedMatch.i)
6361
})
64-
6562
if (dehydratedRouter.lastMatchId) {
6663
dehydratedRouter.lastMatchId = hydrateSsrMatchId(
6764
dehydratedRouter.lastMatchId,
6865
)
6966
}
67+
const { manifest, dehydratedData, lastMatchId } = dehydratedRouter
7068

7169
router.ssr = {
7270
manifest,
@@ -235,8 +233,7 @@ export async function hydrate(router: AnyRouter): Promise<any> {
235233
}),
236234
)
237235

238-
const isSpaMode =
239-
matches[matches.length - 1]!.id !== dehydratedRouter.lastMatchId
236+
const isSpaMode = matches[matches.length - 1]!.id !== lastMatchId
240237
const hasSsrFalseMatches = matches.some((m) => m.ssr === false)
241238
// all matches have data from the server and we are not in SPA mode so we don't need to kick of router.load()
242239
if (!hasSsrFalseMatches && !isSpaMode) {

0 commit comments

Comments
 (0)