@@ -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.
@@ -296,9 +298,13 @@ export function Links(): React.JSX.Element {
296
298
* @param props Props
297
299
* @param props.page The absolute path of the page to prefetch, e.g. `/absolute/path`.
298
300
* @param props.dataLinkProps Additional props to pass to the
299
- * [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link)
300
- * tag, such as `crossOrigin`, `integrity`, `rel`, etc.
301
- * @returns A collection of React elements for `<link>` tags
301
+ * [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
302
+ * tag, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/crossOrigin),
303
+ * [`integrity`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/integrity),
304
+ * [`rel`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel),
305
+ * etc.
306
+ * @returns A collection of React elements for [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
307
+ * tags
302
308
*/
303
309
export function PrefetchPageLinks ( {
304
310
page,
@@ -470,9 +476,10 @@ function PrefetchPageLinksImpl({
470
476
}
471
477
472
478
/**
473
- * Renders all the `<meta>` tags created by the route module
474
- * [`meta`](../../start/framework/route-module#meta) exports. You should render
475
- * it inside the `<head>` of your HTML.
479
+ * Renders all the [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta)
480
+ * tags created by the route module's [`meta`](../../start/framework/route-module#meta)
481
+ * export. You should render it inside the [`<head>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head)
482
+ * of your document.
476
483
*
477
484
* @example
478
485
* import { Meta } from "react-router";
@@ -490,7 +497,8 @@ function PrefetchPageLinksImpl({
490
497
* @public
491
498
* @category Components
492
499
* @mode framework
493
- * @returns A collection of React elements for `<meta>` tags
500
+ * @returns A collection of React elements for [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta)
501
+ * tags
494
502
*/
495
503
export function Meta ( ) : React . JSX . Element {
496
504
let { isSpaMode, routeModules } = useFrameworkContext ( ) ;
@@ -634,10 +642,19 @@ let isHydrated = false;
634
642
/**
635
643
* A couple common attributes:
636
644
*
637
- * - `<Scripts crossOrigin>` for hosting your static assets on a different server than your app.
638
- * - `<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.
645
+ * - `<Scripts crossOrigin>` for hosting your static assets on a different
646
+ * server than your app.
647
+ * - `<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)
648
+ * with [nonce-sources](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#sources)
649
+ * for your [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
650
+ * tags.
639
651
*
640
- * You cannot pass through attributes such as `async`, `defer`, `src`, `type`, `noModule` because they are managed by React Router internally.
652
+ * You cannot pass through attributes such as [`async`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/async),
653
+ * [`defer`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/defer),
654
+ * [`noModule`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/noModule),
655
+ * [`src`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/src),
656
+ * or [`type`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/type),
657
+ * because they are managed by React Router internally.
641
658
*
642
659
* @category Types
643
660
*/
@@ -647,21 +664,22 @@ export type ScriptsProps = Omit<
647
664
| "children"
648
665
| "dangerouslySetInnerHTML"
649
666
| "defer"
650
- | "src"
651
- | "type"
652
667
| "noModule"
668
+ | "src"
653
669
| "suppressHydrationWarning"
670
+ | "type"
654
671
> & {
655
672
/**
656
673
* A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
657
- * attribute to render on [the `<script>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
674
+ * attribute to render on the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
675
+ * element
658
676
*/
659
677
nonce ?: string | undefined ;
660
678
} ;
661
679
662
680
/**
663
681
* Renders the client runtime of your app. It should be rendered inside the
664
- * [`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements /body)
682
+ * [`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element /body)
665
683
* of the document.
666
684
*
667
685
* If server rendering, you can omit `<Scripts/>` and the app will work as a
@@ -686,9 +704,12 @@ export type ScriptsProps = Omit<
686
704
* @category Components
687
705
* @mode framework
688
706
* @param props Props for the
689
- * [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
690
- * tag, such as `crossOrigin`, `nonce`, etc.
691
- * @returns A collection of React elements for `<script>` tags
707
+ * [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
708
+ * tags, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/crossOrigin),
709
+ * [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce),
710
+ * etc.
711
+ * @returns A collection of React elements for [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
712
+ * tags
692
713
*/
693
714
export function Scripts ( props : ScriptsProps ) : React . JSX . Element | null {
694
715
let {
0 commit comments