Skip to content

Commit 509fa62

Browse files
committed
move headcontent to body
1 parent de21f0b commit 509fa62

File tree

10 files changed

+12
-10
lines changed

10 files changed

+12
-10
lines changed

e2e/solid-start/basic-tsr-config/src/app/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ function RootComponent() {
2929
return (
3030
<html>
3131
<head>
32-
<HeadContent />
3332
<HydrationScript />
3433
</head>
3534
<body>
35+
<HeadContent />
3636
<Outlet />
3737
<TanStackRouterDevtools position="bottom-right" />
3838
<Scripts />

e2e/solid-start/basic/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ function RootComponent() {
6969
return (
7070
<html>
7171
<head>
72-
<HeadContent />
7372
<HydrationScript />
7473
</head>
7574
<body>
75+
<HeadContent />
7676
<div class="p-2 flex gap-2 text-lg">
7777
<Link
7878
to="/"

e2e/solid-start/custom-basepath/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ function RootComponent() {
5757
return (
5858
<html>
5959
<head>
60-
<HeadContent />
6160
<HydrationScript />
6261
</head>
6362
<body>
63+
<HeadContent />
6464
<div class="p-2 flex gap-2 text-lg">
6565
<Link
6666
to="/"

e2e/solid-start/scroll-restoration/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ function RootComponent() {
6262
return (
6363
<html>
6464
<head>
65-
<HeadContent />
6665
<HydrationScript />
6766
</head>
6867
<body>
68+
<HeadContent />
6969
<Nav type="header" />
7070
<hr />
7171
<Outlet />

e2e/solid-start/selective-ssr/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ function RootDocument({ children }: { children: Solid.JSX.Element }) {
125125
return (
126126
<html>
127127
<head>
128-
<HeadContent />
129128
<HydrationScript />
130129
</head>
131130
<body>
131+
<HeadContent />
132132
<div class="p-2 flex gap-2 text-lg">
133133
<h1>Selective SSR E2E Test</h1>
134134
<Link

e2e/solid-start/server-functions/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ function RootComponent() {
3434
return (
3535
<html>
3636
<head>
37-
<HeadContent />
3837
<HydrationScript />
3938
</head>
4039
<body>
40+
<HeadContent />
4141
<Outlet />
4242
<TanStackRouterDevtools position="bottom-right" />
4343
<Scripts />

e2e/solid-start/server-routes/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ function RootComponent() {
3434
return (
3535
<html>
3636
<head>
37-
<HeadContent />
3837
<HydrationScript />
3938
</head>
4039
<body>
40+
<HeadContent />
4141
<Outlet />
4242
<TanStackRouterDevtools position="bottom-right" />
4343
<Scripts />

e2e/solid-start/spa-mode/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ function RootDocument({ children }: { children: Solid.JSX.Element }) {
7171
return (
7272
<html>
7373
<head>
74-
<HeadContent />
7574
<HydrationScript />
7675
</head>
7776
<body>
77+
<HeadContent />
7878
<div class="p-2 flex gap-2 text-lg">
7979
<h1>SPA Mode E2E Test</h1>
8080
<Link

e2e/solid-start/website/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ function RootComponent() {
6060
return (
6161
<html>
6262
<head>
63-
<HeadContent />
6463
<HydrationScript />
6564
</head>
6665
<body>
66+
<HeadContent />
6767
<Outlet />
6868
<TanStackRouterDevtools position="bottom-right" />
6969
<Scripts />

packages/solid-router/src/HeadContent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ export const useTags = () => {
182182

183183
/**
184184
* @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.
185-
* It should be rendered in the `<head>` of your document.
185+
* When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`
186+
* to ensure it's part of the reactive tree and updates correctly during client-side navigation.
187+
* The component uses portals internally to render content into the `<head>` element.
186188
*/
187189
export function HeadContent() {
188190
const tags = useTags()

0 commit comments

Comments
 (0)