UNPKG

@tanstack/react-router

Version:

Modern and scalable routing for React applications

1 lines • 1.38 kB
{"version":3,"file":"HeadContent.cjs","names":["useTags","useRouter","_Fragment","Asset"],"sources":["../../src/HeadContent.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Asset } from './Asset'\nimport { useRouter } from './useRouter'\nimport { useTags } from './headContentUtils'\nimport type { AssetCrossOriginConfig } from '@tanstack/router-core'\n\nexport interface HeadContentProps {\n assetCrossOrigin?: AssetCrossOriginConfig\n}\n\n/**\n * Render route-managed head tags (title, meta, links, styles, head scripts).\n * Place inside the document head of your app shell.\n * @link https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management\n */\nexport function HeadContent(props: HeadContentProps) {\n const tags = useTags(props.assetCrossOrigin)\n const router = useRouter()\n const nonce = router.options.ssr?.nonce\n return (\n <>\n {tags.map((tag) => (\n <Asset {...tag} key={`tsr-meta-${JSON.stringify(tag)}`} nonce={nonce} />\n ))}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,SAAgB,YAAY,OAAyB;CACnD,MAAM,OAAOA,yBAAAA,QAAQ,MAAM,gBAAgB;CAE3C,MAAM,QADSC,kBAAAA,UACD,CAAA,CAAO,QAAQ,KAAK;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAAC,kBAAAA,UAAA,EAAA,UACG,KAAK,KAAK,QACT,iBAAA,GAAA,MAAA,cAAA,CAACC,cAAAA,OAAD;EAAO,GAAI;EAAK,KAAK,YAAY,KAAK,UAAU,GAAG;EAAY;CAAQ,CAAA,CACxE,EACD,CAAA;AAEN"}