Skip to content

Commit 2068650

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent 1d48262 commit 2068650

15 files changed

+38
-39
lines changed

docs/api/hooks/useActionData.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ changes are merged.
2121

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

24-
Returns the action data from the most recent POST navigation form submission or `undefined` if there hasn't been one.
24+
Returns the [`action`](../../start/framework/route-module#action) data from the most recent `POST` navigation form submission or `undefined` if there hasn't been one.
2525

2626
```tsx
2727
import { Form, useActionData } from "react-router";

docs/api/hooks/useBlocker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ changes are merged.
2222
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.useBlocker.html)
2323

2424
Allow the application to block navigations within the SPA and present the
25-
user a confirmation dialog to confirm the navigation. Mostly used to avoid
26-
using half-filled form data. This does not handle hard-reloads or
25+
user a confirmation dialog to confirm the navigation. Mostly used to avoid
26+
using half-filled form data. This does not handle hard-reloads or
2727
cross-origin navigations.
2828

29-
The Blocker object returned by the hook has the following properties:
29+
The [`Blocker`](https://api.reactrouter.com/v7/types/react_router.Blocker.html) object returned by the hook has the following properties:
3030

3131
- **`state`**
3232
- `unblocked` - the blocker is idle and has not prevented any navigation

docs/api/hooks/useHref.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ changes are merged.
2121

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

24-
Resolves a URL against the current location.
24+
Resolves a URL against the current [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html).
2525

2626
```tsx
2727
import { useHref } from "react-router";
@@ -48,5 +48,5 @@ The path to resolve
4848

4949
### options.relative
5050

51-
Defaults to "route" so routing is relative to the route tree. Set to "path" to make relative routing operate against path segments.
51+
Defaults to `"route"` so routing is relative to the route tree. Set to `"path"` to make relative routing operate against path segments.
5252

docs/api/hooks/useInRouterContext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ changes are merged.
2121

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

24-
Returns true if this component is a descendant of a Router, useful to ensure
24+
Returns `true` if this component is a descendant of a [`Router`](../declarative-routers/Router), useful to ensure
2525
a component is used within a Router.
2626

2727
## Signature

docs/api/hooks/useMatch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ changes are merged.
2121

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

24-
Returns a PathMatch object if the given pattern matches the current URL.
24+
Returns a [`PathMatch`](https://api.reactrouter.com/v7/interfaces/react_router.PathMatch.html) object if the given pattern matches the current URL.
2525
This is useful for components that need to know "active" state, e.g.
26-
`<NavLink>`.
26+
[`<NavLink>`](../components/NavLink).
2727

2828
## Signature
2929

@@ -35,5 +35,5 @@ useMatch<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: Pat
3535
3636
### pattern
3737
38-
The pattern to match against the current location
38+
The pattern to match against the current [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html)
3939

docs/api/hooks/useMatches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ changes are merged.
2121

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

24-
Returns the active route matches, useful for accessing loaderData for
24+
Returns the active route matches, useful for accessing `loaderData` for
2525
parent/child routes or the route "handle" property
2626

2727
## Signature

docs/api/hooks/useNavigate.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ response to user interactions or effects.
2626

2727
It's often better to use [`redirect`](../utils/redirect) in [`action`](../../start/framework/route-module#action)/[`loader`](../../start/framework/route-module#loader) functions than this hook.
2828

29-
The returned function signature is `navigate(to, options?)/navigate(delta)` where:
29+
The returned function signature is `navigate(to, options?)`/`navigate(delta)` where:
3030

31-
* `to` can be a string path, a `To` object, or a number (delta)
31+
* `to` can be a string path, a [`To`](https://api.reactrouter.com/v7/types/react_router.To.html) object, or a number (delta)
3232
* `options` contains options for modifying the navigation
33-
* `flushSync`: Wrap the DOM updates in `ReactDom.flushSync`
33+
* `flushSync`: Wrap the DOM updates in [`ReactDom.flushSync`](https://react.dev/reference/react-dom/flushSync)
3434
* `preventScrollReset`: Do not scroll back to the top of the page after navigation
35-
* `relative`: "route" or "path" to control relative routing logic
36-
* `replace`: Replace the current entry in the history stack
37-
* `state`: Optional history state to include with the new `Location`
38-
* `viewTransition`: Enable `document.startViewTransition` for this navigation
35+
* `relative`: `"route"` or `"path"` to control relative routing logic
36+
* `replace`: Replace the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack
37+
* `state`: Optional history state to include with the new [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html)
38+
* `viewTransition`: Enable [`document.startViewTransition`](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for this navigation
3939

4040
```tsx
4141
import { useNavigate } from "react-router";
@@ -65,7 +65,7 @@ navigate("/some/route");
6565
navigate("/some/route?search=param");
6666
```
6767

68-
### Navigate with a `To` object
68+
### Navigate with a [`To`](https://api.reactrouter.com/v7/types/react_router.To.html) object
6969

7070
All properties are optional.
7171

@@ -88,17 +88,17 @@ If you use `state`, that will be available on the `location` object on the next
8888
navigate(-1);
8989

9090
// forward
91-
// often used in a multi-step wizard workflows
91+
// often used in a multistep wizard workflows
9292
navigate(1);
9393
```
9494

95-
Be cautions with `navigate(number)`. If your application can load up to a route that has a button that tries to navigate forward/back, there may not be a history entry to go back or forward to, or it can go somewhere you don't expect (like a different domain).
95+
Be cautious with `navigate(number)`. If your application can load up to a route that has a button that tries to navigate forward/back, there may not be a `[`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) entry to go back or forward to, or it can go somewhere you don't expect (like a different domain).
9696

97-
Only use this if you're sure they will have an entry in the history stack to navigate to.
97+
Only use this if you're sure they will have an entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack to navigate to.
9898

9999
### Replace the current entry in the history stack
100100

101-
This will remove the current entry in the history stack, replacing it with a new one, similar to a server side redirect.
101+
This will remove the current entry in the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack, replacing it with a new one, similar to a server side redirect.
102102

103103
```tsx
104104
navigate("/some/route", { replace: true });
@@ -111,11 +111,11 @@ navigate("/some/route", { replace: true });
111111
<br/>
112112
<br/>
113113

114-
To prevent `<ScrollRestoration>` from resetting the scroll position, use the `preventScrollReset` option.
114+
To prevent [`<ScrollRestoration>`](../components/ScrollRestoration) from resetting the scroll position, use the `preventScrollReset` option.
115115

116116
```tsx
117117
navigate("?some-tab=1", { preventScrollReset: true });
118118
```
119119

120-
For example, if you have a tab interface connected to search params in the middle of a page and you don't want it to scroll to the top when a tab is clicked.
120+
For example, if you have a tab interface connected to search params in the middle of a page, and you don't want it to scroll to the top when a tab is clicked.
121121

docs/api/hooks/useNavigation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ changes are merged.
2121

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

24-
Returns the current navigation, defaulting to an "idle" navigation when no navigation is in progress. You can use this to render pending UI (like a global spinner) or read FormData from a form navigation.
24+
Returns the current [`Navigation`](https://api.reactrouter.com/v7/types/react_router.Navigation.html), defaulting to an "idle" navigation when no navigation is in progress. You can use this to render pending UI (like a global spinner) or read [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) from a form navigation.
2525

2626
```tsx
2727
import { useNavigation } from "react-router";

docs/api/hooks/useNavigationType.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ changes are merged.
2121

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

24-
Returns the current navigation action which describes how the router came to
25-
the current location, either by a pop, push, or replace on the history stack.
24+
Returns the current [`Navigation`](https://api.reactrouter.com/v7/types/react_router.Navigation.html) action which describes how the router came to
25+
the current [`Location`](https://api.reactrouter.com/v7/interfaces/react_router.Location.html), either by a pop, push, or replace on the [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History) stack.
2626

2727
## Signature
2828

docs/api/hooks/useOutlet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ changes are merged.
2222
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.useOutlet.html)
2323

2424
Returns the element for the child route at this level of the route
25-
hierarchy. Used internally by `<Outlet>` to render child routes.
25+
hierarchy. Used internally by [`<Outlet>`](../components/Outlet) to render child routes.
2626

2727
## Signature
2828

0 commit comments

Comments
 (0)