UNPKG

@tanstack/solid-router

Version:

Modern and scalable routing for Solid applications

19 lines (18 loc) 783 B
import { toHeadTags, useTags } from "./headContentUtils.js"; import { HydrationScript, createComponent, useHead } from "@solidjs/web"; //#region src/HeadContent.tsx /** * @description The `HeadContent` component registers the current route's meta * tags, links, and scripts with Solid's head registry, which owns emission * into `<head>` (SSR splicing/streaming and client-side patching alike). It * can be rendered anywhere in the tree, though placing it inside the `<head>` * of your document keeps the hydration script in the right place. */ function HeadContent(props) { const tags = useTags(props.assetCrossOrigin); useHead(() => toHeadTags(tags())); return createComponent(HydrationScript, {}); } //#endregion export { HeadContent }; //# sourceMappingURL=HeadContent.js.map