Skip to content
Source
Sign inSign up
TanStack/router

fix: script streaming #5895

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/5895/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 15 changed files with 13 additions and 24 deletions (loading 12).

x
0 of 15 viewed, 15 left
7 additions and 1 deletionpackages/react-router/src/Asset.tsxModified
View file
@@ -144,7 +144,13 @@
}, [attrs, children])
​
if (!router.isServer) {
- return null
+ // render an empty script on the client just to avoid hydration errors
+ return (
+ <script
+ suppressHydrationWarning
+ dangerouslySetInnerHTML={{ __html: '' }}
+ ></script>
+ )
​
if (attrs?.src && typeof attrs.src === 'string') {
5 additions and 22 deletionspackages/react-router/src/HeadContent.tsxModified
View file
@@ -113,9 +113,9 @@
structuralSharing: true as any,
​
- const preloadMeta = useRouterState({