MCPcopy Index your code
hub / github.com/TanStack/router / HeadContent

Function HeadContent

packages/solid-router/src/HeadContent.dev.tsx:18–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 * includes a fallback cleanup effect for hydration mismatch cases.
17 */
18export function HeadContent() {
19 const tags = useTags()
20 const hydrated = useHydrated()
21
22 // Fallback cleanup for hydration mismatch cases
23 // Runs when hydration completes to remove any orphaned dev styles links from DOM
24 createEffect(() => {
25 if (hydrated()) {
26 document
27 .querySelectorAll(`link[${DEV_STYLES_ATTR}]`)
28 .forEach((el) => el.remove())
29 }
30 })
31
32 // Filter out dev styles after hydration
33 const filteredTags = createMemo(() => {
34 if (hydrated()) {
35 return tags().filter((tag) => !tag.attrs?.[DEV_STYLES_ATTR])
36 }
37 return tags()
38 })
39
40 return (
41 <MetaProvider>
42 <For each={filteredTags()}>{(tag) => <Asset {...tag} />}</For>
43 </MetaProvider>
44 )
45}

Callers

nothing calls this directly

Calls 4

useTagsFunction · 0.90
useHydratedFunction · 0.90
filterMethod · 0.80
removeMethod · 0.65

Tested by

no test coverage detected