Skip to content

Commit 84425b9

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent 38e8434 commit 84425b9

File tree

6 files changed

+181
-55
lines changed

6 files changed

+181
-55
lines changed

docs/api/components/Links.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@ title: Links
44

55
# Links
66

7+
<!--
8+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
9+
10+
Thank you for helping improve our documentation!
11+
12+
This file is auto-generated from the JSDoc comments in the source
13+
code, so please edit the JSDoc comments in the file below and this
14+
file will be re-generated once those changes are merged.
15+
16+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/dom/ssr/components.tsx
17+
-->
18+
719
[MODES: framework]
820

921
## Summary
1022

1123
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.Links.html)
1224

13-
Renders all of the `<link>` tags created by route module [`links`](../../start/framework/route-module#links) export. You should render it inside the `<head>` of your document.
25+
Renders all of the `<link>` tags created by the route module
26+
[`links`](../../start/framework/route-module#links) export. You should render
27+
it inside the `<head>` of your document.
1428

1529
```tsx
1630
import { Links } from "react-router";
@@ -27,6 +41,9 @@ export default function Root() {
2741
}
2842
```
2943

30-
## Props
44+
## Signature
45+
46+
```tsx
47+
function Links(): React.JSX.Element
48+
```
3149

32-
None

docs/api/components/Meta.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,27 @@ title: Meta
44

55
# Meta
66

7+
<!--
8+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
9+
10+
Thank you for helping improve our documentation!
11+
12+
This file is auto-generated from the JSDoc comments in the source
13+
code, so please edit the JSDoc comments in the file below and this
14+
file will be re-generated once those changes are merged.
15+
16+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/dom/ssr/components.tsx
17+
-->
18+
719
[MODES: framework]
820

921
## Summary
1022

1123
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.Meta.html)
1224

13-
Renders all the `<meta>` tags created by route module [`meta`](../../start/framework/route-module#meta) export. You should render it inside the `<head>` of your HTML.
25+
Renders all the `<meta>` tags created by the route module
26+
[`meta`](../../start/framework/route-module#meta) exports. You should render
27+
it inside the `<head>` of your HTML.
1428

1529
```tsx
1630
import { Meta } from "react-router";
@@ -26,6 +40,9 @@ export default function Root() {
2640
}
2741
```
2842

29-
## Props
43+
## Signature
44+
45+
```tsx
46+
function Meta(): React.JSX.Element
47+
```
3048

31-
None

docs/api/components/PrefetchPageLinks.md

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,52 @@ title: PrefetchPageLinks
44

55
# PrefetchPageLinks
66

7+
<!--
8+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
9+
10+
Thank you for helping improve our documentation!
11+
12+
This file is auto-generated from the JSDoc comments in the source
13+
code, so please edit the JSDoc comments in the file below and this
14+
file will be re-generated once those changes are merged.
15+
16+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/dom/ssr/components.tsx
17+
-->
18+
719
[MODES: framework]
820

921
## Summary
1022

1123
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.PrefetchPageLinks.html)
1224

13-
Renders `<link rel=prefetch|modulepreload>` tags for modules and data of another page to enable an instant navigation to that page. `<Link prefetch>` uses this internally, but you can render it to prefetch a page for any other reason.
25+
Renders `<link rel=prefetch|modulepreload>` tags for modules and data of
26+
another page to enable an instant navigation to that page.
27+
[`<Link prefetch>`](../../components/Link#prefetch) uses this internally, but
28+
you can render it to prefetch a page for any other reason.
29+
30+
For example, you may render one of this as the user types into a search field
31+
to prefetch search results before they click through to their selection.
1432

1533
```tsx
1634
import { PrefetchPageLinks } from "react-router";
1735

18-
<PrefetchPageLinks page="/absolute/path" />;
36+
<PrefetchPageLinks page="/absolute/path" />
1937
```
2038

21-
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.
22-
23-
## Props
24-
25-
### crossOrigin
26-
27-
[modes: framework]
28-
29-
How the element handles crossorigin requests
30-
31-
### disabled
32-
33-
[modes: framework]
39+
## Signature
3440

35-
Whether the link is disabled
36-
37-
### hrefLang
38-
39-
[modes: framework]
40-
41-
Language of the linked resource
42-
43-
### integrity
44-
45-
[modes: framework]
46-
47-
Integrity metadata used in Subresource Integrity checks
48-
49-
### media
50-
51-
[modes: framework]
41+
```tsx
42+
function PrefetchPageLinks({ page, ...dataLinkProps }: PageLinkDescriptor)
43+
```
5244

53-
Applicable media: "screen", "print", "(max-width: 764px)"
45+
## Props
5446

5547
### page
5648

57-
[modes: framework]
58-
59-
The absolute path of the page to prefetch.
49+
The absolute path of the page to prefetch, e.g. `/absolute/path`.
6050

61-
### referrerPolicy
51+
### dataLinkProps
6252

63-
[modes: framework]
53+
Additional props to pass to the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link)
54+
tag, such as `crossOrigin`, `integrity`, `rel`, etc.
6455

65-
Referrer policy for fetches initiated by the element

docs/api/components/Scripts.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,30 @@ title: Scripts
44

55
# Scripts
66

7+
<!--
8+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
9+
10+
Thank you for helping improve our documentation!
11+
12+
This file is auto-generated from the JSDoc comments in the source
13+
code, so please edit the JSDoc comments in the file below and this
14+
file will be re-generated once those changes are merged.
15+
16+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/dom/ssr/components.tsx
17+
-->
18+
719
[MODES: framework]
820

921
## Summary
1022

1123
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.Scripts.html)
1224

13-
Renders the client runtime of your app. It should be rendered inside the `<body>` of the document.
25+
Renders the client runtime of your app. It should be rendered inside the
26+
`<body>` of the document.
27+
28+
If server rendering, you can omit `<Scripts/>` and the app will work as a
29+
traditional web app without JavaScript, relying solely on HTML and browser
30+
behaviors.
1431

1532
```tsx
1633
import { Scripts } from "react-router";
@@ -27,17 +44,16 @@ export default function Root() {
2744
}
2845
```
2946

30-
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.
47+
## Signature
3148

32-
## Props
33-
34-
### ScriptsProps
49+
```tsx
50+
function Scripts(props: ScriptsProps): React.JSX.Element | null
51+
```
3552

36-
[modes: framework]
53+
## Props
3754

38-
A couple common attributes:
55+
### props
3956

40-
- `<Scripts crossOrigin>` for hosting your static assets on a different server than your app.
41-
- `<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.
57+
Props for the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
58+
tag, such as `crossOrigin`, `nonce`, etc.
4259

43-
You cannot pass through attributes such as `async`, `defer`, `src`, `type`, `noModule` because they are managed by React Router internally.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: HydratedRouter
3+
---
4+
5+
# HydratedRouter
6+
7+
<!--
8+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
9+
10+
Thank you for helping improve our documentation!
11+
12+
This file is auto-generated from the JSDoc comments in the source
13+
code, so please edit the JSDoc comments in the file below and this
14+
file will be re-generated once those changes are merged.
15+
16+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/dom-export/hydrated-router.tsx
17+
-->
18+
19+
[MODES: framework]
20+
21+
## Summary
22+
23+
Framework-mode router component to be used to to hydrate a router from a
24+
`ServerRouter`. See [`entry.client.tsx`](../api/framework-conventions/entry.client.tsx).
25+
26+
## Signature
27+
28+
```tsx
29+
function HydratedRouter(props: HydratedRouterProps)
30+
```
31+
32+
## Props
33+
34+
### unstable_getContext
35+
36+
Context object to passed through to [`createBrowserRouter`](../data-routers/createBrowserRouter) and made available to `clientLoader`/`clientAction`
37+
functions
38+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: ServerRouter
3+
---
4+
5+
# ServerRouter
6+
7+
<!--
8+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
9+
10+
Thank you for helping improve our documentation!
11+
12+
This file is auto-generated from the JSDoc comments in the source
13+
code, so please edit the JSDoc comments in the file below and this
14+
file will be re-generated once those changes are merged.
15+
16+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/dom/ssr/server.tsx
17+
-->
18+
19+
[MODES: framework]
20+
21+
## Summary
22+
23+
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.ServerRouter.html)
24+
25+
The server entry point for a React Router app in Framework Mode. This component
26+
is used to generate the HTML in the response from the server.
27+
See [`entry.server.tsx`](../api/framework-conventions/entry.server.tsx).
28+
29+
## Signature
30+
31+
```tsx
32+
function ServerRouter({ context, url, nonce, }: ServerRouterProps): ReactElement
33+
```
34+
35+
## Props
36+
37+
### context
38+
39+
The entry context containing the manifest, route modules, and other data needed for rendering.
40+
41+
### url
42+
43+
The URL of the request being handled.
44+
45+
### nonce
46+
47+
An optional nonce for Content Security Policy (CSP) compliance, used to allow inline scripts to run safely.
48+

0 commit comments

Comments
 (0)