@tanstack/solid-router
Version:
Modern and scalable routing for Solid applications
17 lines • 789 B
JSX
import { MetaProvider } from '@solidjs/meta';
import { For } from 'solid-js';
import { Asset } from './Asset';
import { useTags } from './headContentUtils';
/**
* @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.
* When using full document hydration (hydrating from `<html>`), this component should be rendered in the `<body>`
* to ensure it's part of the reactive tree and updates correctly during client-side navigation.
* The component uses portals internally to render content into the `<head>` element.
*/
export function HeadContent() {
const tags = useTags();
return (<MetaProvider>
<For each={tags()}>{(tag) => <Asset {...tag}/>}</For>
</MetaProvider>);
}
//# sourceMappingURL=HeadContent.jsx.map