Skip to content
Source
Sign inSign up
TanStack/router

fix: keep server-rendered pending UI of no-SSR routes through hydration (take 2) #8649

OpenSheraff(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromfix/no-ssr-hydration-v2opened

Showing 19 changed files with 40 additions and 7 deletions (loading 17).

x
0 of 19 viewed, 19 left
8 additions and 0 deletions.changeset/no-ssr-pending-hydration.mdAdded
View file
@@ -0,0 +1,8 @@
+---
+'@tanstack/router-core': patch
+'@tanstack/react-router': patch
+'@tanstack/solid-router': patch
+'@tanstack/vue-router': patch
+---
+​
+Keep the server-rendered pending component of `ssr: false` and `ssr: 'data-only'` routes mounted through hydration instead of mounting a second copy
32 additions and 7 deletionspackages/react-router/src/Match.tsxModified
View file
@@ -10,7 +10,7 @@
import { matchContext } from './matchContext'
import { renderRouteNotFound } from './renderRouteNotFound'
import { ScrollRestoration } from './scroll-restoration'
-import { ClientOnly } from './ClientOnly'
+import { useLayoutEffect } from './utils'
import {
nonRouteComponentContext,
wrapInNonRouteComponentContext,
@@ -73,7 +73,20 @@
​
const matchStore = router.stores.getMatchStore(routeId)