Skip to content

Commit 703eb02

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent 8879508 commit 703eb02

32 files changed

+466
-398
lines changed

docs/api/components/Form.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do
2323
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.Form.html)
2424

2525
A progressively enhanced HTML [`<form>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form)
26-
that submits data to actions via [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API),
26+
that submits data to actions via [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch),
2727
activating pending states in [`useNavigation`](../hooks/useNavigation) which enables advanced
2828
user interfaces beyond a basic HTML [`<form>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form).
2929
After a form's `action` completes, all data on the page is automatically
@@ -37,7 +37,8 @@ enabling web application user experiences.
3737

3838
`Form` is most useful for submissions that should also change the URL or
3939
otherwise add an entry to the browser history stack. For forms that shouldn't
40-
manipulate the browser history stack, use [`<fetcher.Form>`][fetcher_form].
40+
manipulate the browser [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
41+
stack, use [`<fetcher.Form>`](https://api.reactrouter.com/v7/types/react_router.FetcherWithComponents.html#Form).
4142

4243
```tsx
4344
import { Form } from "react-router";
@@ -69,8 +70,8 @@ Defines the link discovery behavior. See [`DiscoverBehavior`](https://api.reactr
6970
<Link discover="none" />
7071
```
7172

72-
- **render** - default, discover the route when the link renders
73-
- **none** - don't eagerly discover, only discover if the link is clicked
73+
- **render** default, discover the route when the link renders
74+
- **none** don't eagerly discover, only discover if the link is clicked
7475

7576
### encType
7677

@@ -89,11 +90,11 @@ can pick up the fetcher's state in a different component in a [`useFetcher`](../
8990

9091
### method
9192

92-
The HTTP verb to use when the form is submitted. Supports "get", "post",
93-
"put", "delete", and "patch".
93+
The HTTP verb to use when the form is submitted. Supports `"delete"`,
94+
`"get"`, `"patch"`, `"post"`, and `"put"`.
9495

9596
Native [`<form>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form)
96-
only supports `get` and `post`, avoid the other verbs if you'd like to
97+
only supports `"get"` and `"post"`, avoid the other verbs if you'd like to
9798
support progressive enhancement
9899

99100
### navigate

docs/api/components/Link.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Defines the link discovery behavior
5353
<Link discover="none" />
5454
```
5555

56-
- **render** - default, discover the route when the link renders
57-
- **none** - don't eagerly discover, only discover if the link is clicked
56+
- **render** default, discover the route when the link renders
57+
- **none** don't eagerly discover, only discover if the link is clicked
5858

5959
### prefetch
6060

@@ -70,10 +70,10 @@ Defines the data and module prefetching behavior for the link.
7070
<Link prefetch="viewport" />
7171
```
7272

73-
- **none** - default, no prefetching
74-
- **intent** - prefetches when the user hovers or focuses the link
75-
- **render** - prefetches when the link renders
76-
- **viewport** - prefetches when the link is in the viewport, very useful for mobile
73+
- **none** default, no prefetching
74+
- **intent** prefetches when the user hovers or focuses the link
75+
- **render** prefetches when the link renders
76+
- **viewport** prefetches when the link is in the viewport, very useful for mobile
7777

7878
Prefetching is done with HTML [`<link rel="prefetch">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
7979
tags. They are inserted after the link.
@@ -116,10 +116,10 @@ Defines the relative path behavior for the link.
116116
Consider a route hierarchy where a parent route pattern is `"blog"` and a child
117117
route pattern is `"blog/:slug/edit"`.
118118

119-
- **route** - default, resolves the link relative to the route pattern. In the
120-
example above, a relative link of `".."` will remove both `:slug/edit` segments
119+
- **route** default, resolves the link relative to the route pattern. In the
120+
example above, a relative link of `"..."` will remove both `:slug/edit` segments
121121
back to `"/blog"`.
122-
- **path** - relative to the path so `".."` will only remove one URL segment up
122+
- **path** relative to the path so `"..."` will only remove one URL segment up
123123
to `"/blog/:slug"`
124124

125125
Note that index routes and layout routes do not have paths so they are not
@@ -142,7 +142,7 @@ clicked: the browser will handle the transition normally (as if it were an
142142
[modes: framework, data, declarative]
143143

144144
Replaces the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
145-
stack instead of pushing a new one onto it.
145+
stack instead of pushing a new one onto it.
146146

147147
```tsx
148148
<Link replace />

docs/api/components/Links.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do
2222

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

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.
25+
Renders all the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
26+
tags created by the route module's [`links`](../../start/framework/route-module#links)
27+
export. You should render it inside the [`<head>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head)
28+
of your document.
2829

2930
```tsx
3031
import { Links } from "react-router";

docs/api/components/Meta.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do
2222

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

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.
25+
Renders all the [`<meta>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta)
26+
tags created by the route module's [`meta`](../../start/framework/route-module#meta)
27+
export. You should render it inside the [`<head>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head)
28+
of your document.
2829

2930
```tsx
3031
import { Meta } from "react-router";

docs/api/components/NavLink.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ Defines the link discovery behavior
117117
<Link discover="none" />
118118
```
119119

120-
- **render** - default, discover the route when the link renders
121-
- **none** - don't eagerly discover, only discover if the link is clicked
120+
- **render** default, discover the route when the link renders
121+
- **none** don't eagerly discover, only discover if the link is clicked
122122

123123
### end
124124

@@ -153,10 +153,10 @@ Defines the data and module prefetching behavior for the link.
153153
<Link prefetch="viewport" />
154154
```
155155

156-
- **none** - default, no prefetching
157-
- **intent** - prefetches when the user hovers or focuses the link
158-
- **render** - prefetches when the link renders
159-
- **viewport** - prefetches when the link is in the viewport, very useful for mobile
156+
- **none** default, no prefetching
157+
- **intent** prefetches when the user hovers or focuses the link
158+
- **render** prefetches when the link renders
159+
- **viewport** prefetches when the link is in the viewport, very useful for mobile
160160

161161
Prefetching is done with HTML [`<link rel="prefetch">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
162162
tags. They are inserted after the link.
@@ -199,10 +199,10 @@ Defines the relative path behavior for the link.
199199
Consider a route hierarchy where a parent route pattern is `"blog"` and a child
200200
route pattern is `"blog/:slug/edit"`.
201201

202-
- **route** - default, resolves the link relative to the route pattern. In the
203-
example above, a relative link of `".."` will remove both `:slug/edit` segments
202+
- **route** default, resolves the link relative to the route pattern. In the
203+
example above, a relative link of `"..."` will remove both `:slug/edit` segments
204204
back to `"/blog"`.
205-
- **path** - relative to the path so `".."` will only remove one URL segment up
205+
- **path** relative to the path so `"..."` will only remove one URL segment up
206206
to `"/blog/:slug"`
207207

208208
Note that index routes and layout routes do not have paths so they are not
@@ -225,7 +225,7 @@ clicked: the browser will handle the transition normally (as if it were an
225225
[modes: framework, data, declarative]
226226

227227
Replaces the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
228-
stack instead of pushing a new one onto it.
228+
stack instead of pushing a new one onto it.
229229

230230
```tsx
231231
<Link replace />

docs/api/components/PrefetchPageLinks.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do
2222

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

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.
25+
Renders [`<link rel=prefetch|modulepreload>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel)
26+
tags for modules and data of another page to enable an instant navigation to
27+
that page. [`<Link prefetch>`](./Link#prefetch) uses this internally, but you
28+
can render it to prefetch a page for any other reason.
2929

3030
For example, you may render one of this as the user types into a search field
3131
to prefetch search results before they click through to their selection.
@@ -50,6 +50,8 @@ The absolute path of the page to prefetch, e.g. `/absolute/path`.
5050

5151
### linkProps
5252

53-
Additional props to spread onto the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link)
54-
tags, such as `crossOrigin`, `integrity`, `rel`, etc.
53+
Additional props to spread onto the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) tags, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/crossOrigin),
54+
[`integrity`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/integrity),
55+
[`rel`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel),
56+
etc.
5557

docs/api/components/Scripts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do
2323
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.Scripts.html)
2424

2525
Renders the client runtime of your app. It should be rendered inside the
26-
[`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/body)
26+
[`<body>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body)
2727
of the document.
2828

2929
If server rendering, you can omit `<Scripts/>` and the app will work as a
@@ -55,6 +55,7 @@ function Scripts(scriptProps: ScriptsProps): React.JSX.Element | null
5555

5656
### scriptProps
5757

58-
Additional props to spread onto the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
59-
tag, such as `crossOrigin`, `nonce`, etc.
58+
Additional props to spread onto the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) tags, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/crossOrigin),
59+
[`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce),
60+
etc.
6061

docs/api/components/ScrollRestoration.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function ScrollRestoration({
6161

6262
A function that returns a key to use for scroll restoration. This is useful
6363
for custom scroll restoration logic, such as using only the pathname so
64-
that subsequent navigations to prior paths will restore the scroll. Defaults
65-
to `location.key`. See [`GetScrollRestorationKeyFunction`](https://api.reactrouter.com/v7/interfaces/react_router.GetScrollRestorationKeyFunction.html).
64+
that later navigations to prior paths will restore the scroll. Defaults to
65+
`location.key`. See [`GetScrollRestorationKeyFunction`](https://api.reactrouter.com/v7/interfaces/react_router.GetScrollRestorationKeyFunction.html).
6666

6767
```tsx
6868
<ScrollRestoration
@@ -79,7 +79,8 @@ to `location.key`. See [`GetScrollRestorationKeyFunction`](https://api.reactrout
7979
### nonce
8080

8181
A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
82-
attribute to render on [the `<script>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script)
82+
attribute to render on the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
83+
element
8384

8485
### storageKey
8586

docs/api/data-routers/StaticRouterProvider.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/do
2222

2323
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.StaticRouterProvider.html)
2424

25-
A Data Router that may not navigate to any other location. This is useful
26-
on the server where there is no stateful UI.
25+
A [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html) that may not navigate to any other [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html).
26+
This is useful on the server where there is no stateful UI.
2727

2828
```tsx
2929
export async function handleRequest(request: Request) {
@@ -57,17 +57,20 @@ function StaticRouterProvider({
5757

5858
### context
5959

60-
The [`StaticHandlerContext`](https://api.reactrouter.com/v7/interfaces/react_router.StaticHandlerContext.html) returned from `staticHandler.query()`
61-
62-
### router
63-
64-
The static data router from [`createStaticRouter`](../data-routers/createStaticRouter)
60+
The [`StaticHandlerContext`](https://api.reactrouter.com/v7/interfaces/react_router.StaticHandlerContext.html) returned from [`StaticHandler`](https://api.reactrouter.com/v7/interfaces/react_router.StaticHandler.html)'s
61+
`query`
6562

6663
### hydrate
6764

6865
Whether to hydrate the router on the client (default `true`)
6966

7067
### nonce
7168

72-
The [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce) to use for the hydration `<script>` tag
69+
The [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
70+
to use for the hydration [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
71+
tag
72+
73+
### router
74+
75+
The static [`DataRouter`](https://api.reactrouter.com/v7/interfaces/react_router.DataRouter.html) from [`createStaticRouter`](../data-routers/createStaticRouter)
7376

0 commit comments

Comments
 (0)