0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/.changeset/brown-breads-begin.md
Brenley Dueck 129d043f2d
fix(solid-router): prevent HeadContent hydration warnings (#7510)
* fix(solid-router): prevent HeadContent hydration warnings and navigation FOUC

Fix two related issues with HeadContent in solid-router:

1. Hydration: render bare element templates with one getNextElement per
   invocation (switch instead of if/return), call hydration-affecting
   hooks unconditionally, and capture the relocated node via the JSX
   return value instead of a ref attribute so SSR attributes on void
   meta/link elements are preserved. Eliminates "unclaimed
   server-rendered node" warnings.

2. FOUC: stabilize head tag object identity per-key across renders so
   <For> (which keys by reference) reconciles unchanged tags in place
   instead of remounting every head node on navigation. Previously a
   single changed tag (e.g. title) invalidated the whole array,
   remounting the app stylesheet link and briefly detaching it, causing
   a flash of unstyled content in dark mode.

* chore: add changeset

* fix(solid-router): preserve CSP nonce on styles

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-31 00:41:10 +02:00

287 B

@tanstack/solid-router-ssr-query @tanstack/solid-router-devtools @tanstack/solid-start-client @tanstack/solid-start-server @tanstack/solid-router @tanstack/solid-start
patch patch patch patch patch patch

Fix two related issues with HeadContent in solid-router