You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Renders `<link rel=prefetch|modulepreload>` tags for modules and data of another page to enable an instant navigation to that page. {@link LinkProps.prefetch | `<Link prefetch>`} uses this internally, but you can render it to prefetch a page for any other reason.
268
-
269
-
```tsx
270
-
import { PrefetchPageLinks } from "react-router"
271
-
272
-
<PrefetchPageLinks page="/absolute/path" />
273
-
```
274
-
275
-
For example, you may render one of this as the user types into a search field to prefetch search results before they click through to their selection.
276
-
277
-
@category Components
271
+
* Renders `<link rel=prefetch|modulepreload>` tags for modules and data of
272
+
* another page to enable an instant navigation to that page.
273
+
* [`<Link prefetch>`](../../components/Link#prefetch) uses this internally, but
274
+
* you can render it to prefetch a page for any other reason.
275
+
*
276
+
* For example, you may render one of this as the user types into a search field
277
+
* to prefetch search results before they click through to their selection.
278
+
*
279
+
* @example
280
+
* import { PrefetchPageLinks } from "react-router";
281
+
*
282
+
* <PrefetchPageLinks page="/absolute/path" />
283
+
*
284
+
* @public
285
+
* @category Components
286
+
* @mode framework
287
+
* @param props Props
288
+
* @param props.page The absolute path of the page to prefetch, e.g. `/absolute/path`.
289
+
* @param props.dataLinkProps Additional props to pass to the
@@ -604,14 +623,14 @@ function isValidMetaTag(tagName: unknown): tagName is "meta" | "link" {
604
623
letisHydrated=false;
605
624
606
625
/**
607
-
A couple common attributes:
608
-
609
-
- `<Scripts crossOrigin>` for hosting your static assets on a different server than your app.
610
-
- `<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.
611
-
612
-
You cannot pass through attributes such as `async`, `defer`, `src`, `type`, `noModule` because they are managed by React Router internally.
613
-
614
-
@category Types
626
+
* A couple common attributes:
627
+
*
628
+
* - `<Scripts crossOrigin>` for hosting your static assets on a different server than your app.
629
+
* - `<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.
630
+
*
631
+
* You cannot pass through attributes such as `async`, `defer`, `src`, `type`, `noModule` because they are managed by React Router internally.
632
+
*
633
+
*@category Types
615
634
*/
616
635
exporttypeScriptsProps=Omit<
617
636
React.HTMLProps<HTMLScriptElement>,
@@ -632,28 +651,36 @@ export type ScriptsProps = Omit<
632
651
};
633
652
634
653
/**
635
-
Renders the client runtime of your app. It should be rendered inside the `<body>` of the document.
636
-
637
-
```tsx
638
-
import { Scripts } from "react-router";
639
-
640
-
export default function Root() {
641
-
return (
642
-
<html>
643
-
<head />
644
-
<body>
645
-
<Scripts />
646
-
</body>
647
-
</html>
648
-
);
649
-
}
650
-
```
651
-
652
-
If server rendering, you can omit `<Scripts/>` and the app will work as a traditional web app without JavaScript, relying solely on HTML and browser behaviors.
653
-
654
-
@category Components
654
+
* Renders the client runtime of your app. It should be rendered inside the
655
+
* `<body>` of the document.
656
+
*
657
+
* If server rendering, you can omit `<Scripts/>` and the app will work as a
658
+
* traditional web app without JavaScript, relying solely on HTML and browser
0 commit comments