@@ -215,9 +215,10 @@ function getActiveMatches(
215
215
export const CRITICAL_CSS_DATA_ATTRIBUTE = "data-react-router-critical-css" ;
216
216
217
217
/**
218
- * Renders all of the `<link>` tags created by the route module
219
- * [`links`](../../start/framework/route-module#links) export. You should render
220
- * it inside the `<head>` of your document.
218
+ * Renders all the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
219
+ * tags created by the route module's [`links`](../../start/framework/route-module#links)
220
+ * export. You should render it inside the [`<head>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head)
221
+ * of your document.
221
222
*
222
223
* @example
223
224
* import { Links } from "react-router";
@@ -236,7 +237,8 @@ export const CRITICAL_CSS_DATA_ATTRIBUTE = "data-react-router-critical-css";
236
237
* @public
237
238
* @category Components
238
239
* @mode framework
239
- * @returns A collection of React elements for `<link>` tags
240
+ * @returns A collection of React elements for [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
241
+ * tags
240
242
*/
241
243
export function Links ( ) : React . JSX . Element {
242
244
let { isSpaMode, manifest, routeModules, criticalCss } =
@@ -277,10 +279,10 @@ export function Links(): React.JSX.Element {
277
279
}
278
280
279
281
/**
280
- * Renders `<link rel=prefetch|modulepreload>` tags for modules and data of
281
- * another page to enable an instant navigation to that page.
282
- * [`<Link prefetch>`](../../components/ Link#prefetch) uses this internally, but
283
- * you can render it to prefetch a page for any other reason.
282
+ * Renders [ `<link rel=prefetch|modulepreload>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel)
283
+ * tags for modules and data of another page to enable an instant navigation to
284
+ * that page. [`<Link prefetch>`](./ Link#prefetch) uses this internally, but you
285
+ * can render it to prefetch a page for any other reason.
284
286
*
285
287
* For example, you may render one of this as the user types into a search field
286
288
* to prefetch search results before they click through to their selection.
@@ -294,11 +296,14 @@ export function Links(): React.JSX.Element {
294
296
* @category Components
295
297
* @mode framework
296
298
* @param props Props
297
- * @param props.page The absolute path of the page to prefetch, e.g. `/absolute/path`.
298
- * @param props.linkProps Additional props to spread onto the
299
- * [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link)
300
- * tags, such as `crossOrigin`, `integrity`, `rel`, etc.
301
- * @returns A collection of React elements for `<link>` tags
299
+ * @param {PageLinkDescriptor.page } props.page n/a
300
+ * @param props.linkProps Additional props to spread onto the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
301
+ * tags, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/crossOrigin),
302
+ * [`integrity`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/integrity),
303
+ * [`rel`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel),
304
+ * etc.
305
+ * @returns A collection of React elements for [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
306
+ * tags
302
307
*/
303
308
export function PrefetchPageLinks ( { page, ...linkProps } : PageLinkDescriptor ) {
304
309
let { router } = useDataRouterContext ( ) ;
@@ -465,9 +470,10 @@ function PrefetchPageLinksImpl({
465
470
}
466
471
467
472
/**
468
- * Renders all the `<meta>` tags created by the route module
469
- * [`meta`](../../start/framework/route-module#meta) exports. You should render
470
- * it inside the `<head>` of your HTML.
473
+ * Renders all the [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta)
474
+ * tags created by the route module's [`meta`](../../start/framework/route-module#meta)
475
+ * export. You should render it inside the [`<head>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head)
476
+ * of your document.
471
477
*
472
478
* @example
473
479
* import { Meta } from "react-router";
@@ -485,7 +491,8 @@ function PrefetchPageLinksImpl({
485
491
* @public
486
492
* @category Components
487
493
* @mode framework
488
- * @returns A collection of React elements for `<meta>` tags
494
+ * @returns A collection of React elements for [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta)
495
+ * tags
489
496
*/
490
497
export function Meta ( ) : React . JSX . Element {
491
498
let { isSpaMode, routeModules } = useFrameworkContext ( ) ;
@@ -629,10 +636,19 @@ let isHydrated = false;
629
636
/**
630
637
* A couple common attributes:
631
638
*
632
- * - `<Scripts crossOrigin>` for hosting your static assets on a different server than your app.
633
- * - `<Scripts nonce>` to support a [content security policy for scripts](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src) with [nonce-sources](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#sources) for your `<script>` tags.
639
+ * - `<Scripts crossOrigin>` for hosting your static assets on a different
640
+ * server than your app.
641
+ * - `<Scripts nonce>` to support a [content security policy for scripts](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src)
642
+ * with [nonce-sources](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#sources)
643
+ * for your [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
644
+ * tags.
634
645
*
635
- * You cannot pass through attributes such as `async`, `defer`, `src`, `type`, `noModule` because they are managed by React Router internally.
646
+ * You cannot pass through attributes such as [`async`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/async),
647
+ * [`defer`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/defer),
648
+ * [`noModule`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/noModule),
649
+ * [`src`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/src),
650
+ * or [`type`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/type),
651
+ * because they are managed by React Router internally.
636
652
*
637
653
* @category Types
638
654
*/
@@ -642,21 +658,22 @@ export type ScriptsProps = Omit<
642
658
| "children"
643
659
| "dangerouslySetInnerHTML"
644
660
| "defer"
645
- | "src"
646
- | "type"
647
661
| "noModule"
662
+ | "src"
648
663
| "suppressHydrationWarning"
664
+ | "type"
649
665
> & {
650
666
/**
651
667
* A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
652
- * attribute to render on [the `<script>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
668
+ * attribute to render on the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
669
+ * element
653
670
*/
654
671
nonce ?: string | undefined ;
655
672
} ;
656
673
657
674
/**
658
675
* Renders the client runtime of your app. It should be rendered inside the
659
- * [`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements /body)
676
+ * [`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element /body)
660
677
* of the document.
661
678
*
662
679
* If server rendering, you can omit `<Scripts/>` and the app will work as a
@@ -680,10 +697,12 @@ export type ScriptsProps = Omit<
680
697
* @public
681
698
* @category Components
682
699
* @mode framework
683
- * @param scriptProps Additional props to spread onto the
684
- * [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
685
- * tag, such as `crossOrigin`, `nonce`, etc.
686
- * @returns A collection of React elements for `<script>` tags
700
+ * @param scriptProps Additional props to spread onto the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
701
+ * tags, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/crossOrigin),
702
+ * [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce),
703
+ * etc.
704
+ * @returns A collection of React elements for [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
705
+ * tags
687
706
*/
688
707
export function Scripts ( scriptProps : ScriptsProps ) : React . JSX . Element | null {
689
708
let {
0 commit comments