@tanstack/solid-router
Version:
Modern and scalable routing for Solid applications
28 lines (27 loc) • 1.18 kB
JavaScript
require("./_virtual/_rolldown/runtime.cjs");
const require_Asset = require("./Asset.cjs");
const require_headContentUtils = require("./headContentUtils.cjs");
let solid_js_web = require("solid-js/web");
let solid_js = require("solid-js");
let _solidjs_meta = require("@solidjs/meta");
//#region src/HeadContent.tsx
/**
* @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.
*/
function HeadContent() {
const tags = require_headContentUtils.useTags();
return (0, solid_js_web.createComponent)(_solidjs_meta.MetaProvider, { get children() {
return (0, solid_js_web.createComponent)(solid_js.For, {
get each() {
return tags();
},
children: (tag) => (0, solid_js_web.createComponent)(require_Asset.Asset, tag)
});
} });
}
//#endregion
exports.HeadContent = HeadContent;
//# sourceMappingURL=HeadContent.cjs.map