Skip to content

Commit 4bf011a

Browse files
docs(hooks): fix grammar + typos (#10653)
1 parent b9b0e21 commit 4bf011a

13 files changed

+27
-27
lines changed

docs/hooks/use-action-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ toc: false
55

66
# `useActionData`
77

8-
Returns the serialized data from the most recent route [action][action] or `undefined` if there isn't one. This hook only returns action data from the route in context - it can not access data from other parent or child routes.
8+
Returns the serialized data from the most recent route [action][action] or `undefined` if there isn't one. This hook only returns action data from the route in context it cannot access data from other parent or child routes.
99

1010
```tsx lines=[10,14]
1111
import type { ActionFunctionArgs } from "@remix-run/node"; // or cloudflare/deno

docs/hooks/use-before-unload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toc: false
77

88
This hook is just a helper around [`window.beforeunload`][window_before_unload].
99

10-
When users click links to pages they haven't visited yet, Remix loads the code-split modules for that page. If you deploy in the middle of a user's session, and you or your host removes the old files from the server (many do 😭), then Remix's requests for those modules will fail. Remix recovers by automatically reloading the browser at the new URL. This should start over from the server with the latest version of your application. Most of the time this works out great, and user doesn't even know anything happened.
10+
When users click links to pages they haven't visited yet, Remix loads the code-split modules for that page. If you deploy in the middle of a user's session, and you or your host removes the old files from the server (many do 😭), then Remix's requests for those modules will fail. Remix recovers by automatically reloading the browser at the new URL. This should start over from the server with the latest version of your application. Most of the time this works out great, and the user doesn't even know anything happened.
1111

1212
In this situation, you may need to save important application state on the page (to something like the browser's local storage), because the automatic page reload will lose any state you had.
1313

docs/hooks/use-blocker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ title: useBlocker
77
The `useBlocker` hook allows you to prevent the user from navigating away from the current location, and present them with a custom UI to allow them to confirm the navigation.
88

99
<docs-info>
10-
This only works for client-side navigations within your React Router application and will not block document requests. To prevent document navigations you will need to add your own <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event" target="_blank">`beforeunload`</a> event handler.
10+
This only works for client-side navigations within your React Router application and will not block document requests. To prevent document navigations, you will need to add your own <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event" target="_blank">`beforeunload`</a> event handler.
1111
</docs-info>
1212

1313
<docs-warning>
14-
Blocking a user from navigating is a bit of an anti-pattern, so please carefully consider any usage of this hook and use it sparingly. In the de-facto use case of preventing a user navigating away from a half-filled form, you might consider persisting unsaved state to `sessionStorage` and automatically re-filling it if they return instead of blocking them from navigating away.
14+
Blocking a user from navigating is a bit of an antipattern, so please carefully consider any usage of this hook and use it sparingly. In the de-facto use case of preventing a user navigating away from a half-filled form, you might consider persisting unsaved state to `sessionStorage` and automatically re-filling it if they return instead of blocking them from navigating away.
1515
</docs-warning>
1616

1717
```tsx
@@ -77,6 +77,6 @@ When in a `blocked` state, you may call `blocker.proceed()` to proceed to the bl
7777

7878
### `reset()`
7979

80-
When in a `blocked` state, you may call `blocker.reset()` to return the blocker back to an `unblocked` state and leave the user at the current location.
80+
When in a `blocked` state, you may call `blocker.reset()` to return the blocker to an `unblocked` state and leave the user at the current location.
8181

8282
[example]: https://github.com/remix-run/react-router/tree/main/examples/navigation-blocking

docs/hooks/use-fetcher.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fetcher.submit(
112112

113113
Loads data from a route loader. While multiple nested routes can match a URL, only the leaf route will be called.
114114

115-
Note that when calling `load` on an index route's loader, you must include an [`?index` query param][index-query-param] in order to disambiguate between the `index.tsx` layout and the `root.tsx` route.
115+
Note that when calling `load` on an index route's loader, you must include an [`?index` query param][index-query-param] to disambiguate between the `index.tsx` layout and the `root.tsx` route.
116116

117117
```ts
118118
fetcher.load("/some/route");
@@ -133,9 +133,9 @@ The `flushSync` option tells React Router DOM to wrap the initial state update f
133133

134134
You can know the state of the fetcher with `fetcher.state`. It will be one of:
135135

136-
- **idle** - Nothing is being fetched.
137-
- **submitting** - A form has been submitted. If the method is `GET`, then the route `loader` is being called. If `DELETE`, `PATCH`, `POST`, or `PUT`, then the route `action` is being called.
138-
- **loading** - The loaders for the routes are being reloaded after an `action` submission.
136+
- **idle** Nothing is being fetched.
137+
- **submitting** A form has been submitted. If the method is `GET`, then the route `loader` is being called. If `DELETE`, `PATCH`, `POST`, or `PUT`, then the route `action` is being called.
138+
- **loading** The loaders for the routes are being reloaded after an `action` submission.
139139

140140
### `fetcher.data`
141141

docs/hooks/use-fetchers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ toc: false
55

66
# `useFetchers`
77

8-
Returns an array of all in-flight fetchers. This is useful for components throughout the app that didn't create the fetchers but want to use their submissions to participate in optimistic UI.
8+
Returns an array of all in-flight fetchers. This is useful for components throughout the app that didn't create the fetchers but want to use their submissions to participate in an optimistic UI.
99

1010
```tsx
1111
import { useFetchers } from "@remix-run/react";

docs/hooks/use-form-action.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Optional. The action to append to the closest route URL.
3434

3535
The only option is `{ relative: "route" | "path"}`.
3636

37-
- **route** default - relative to the route hierarchy, not the URL
38-
- **path** - makes the action relative to the URL paths, so `..` will remove one URL segment.
37+
- **route** default relative to the route hierarchy, not the URL
38+
- **path** makes the action relative to the URL paths, so `..` will remove one URL segment.
3939

4040
[form_component]: ../components/form

docs/hooks/use-href.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Optional. The path to append to the resolved URL.
3232

3333
The only option is `{ relative: "route" | "path"}`, which defines the behavior when resolving relative URLs.
3434

35-
- **route** default - relative to the route hierarchy, not the URL
36-
- **path** - makes the action relative to the URL paths, so `..` will remove one URL segment.
35+
- **route** default relative to the route hierarchy, not the URL
36+
- **path** makes the action relative to the URL paths, so `..` will remove one URL segment.
3737

3838
[anchor_element_href_attribute]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#href
3939
[anchor_element]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link

docs/hooks/use-navigate.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ navigate(".", {
7878
});
7979
```
8080

81-
- **replace**: boolean - replace the current entry in the history stack instead of pushing a new one
82-
- **relative**: `"route" | "path"` - defines the relative path behavior for the link
81+
- **replace**: boolean replace the current entry in the history stack instead of pushing a new one
82+
- **relative**: `"route" | "path"` defines the relative path behavior for the link
8383
- `"route"` will use the route hierarchy so `".."` will remove all URL segments of the current route pattern while `"path"` will use the URL path so `".."` will remove one URL segment
84-
- **state**: any - adds persistent client side routing state to the next location
84+
- **state**: any adds persistent client side routing state to the next location
8585
- **preventScrollReset**: boolean - if you are using [`<ScrollRestoration>`][scroll-restoration], prevent the scroll position from being reset to the top of the window when navigating
86-
- **flushSync**: boolean - wraps the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition]
87-
- **viewTransition**: boolean - enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`
86+
- **flushSync**: boolean wraps the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition]
87+
- **viewTransition**: boolean enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`
8888
- If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state]
8989

9090
[redirect]: ../utils/redirect

docs/hooks/use-navigation-type.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function SomeComponent() {
1818
## Return Values
1919

2020
- **PUSH**: The user came to the current page via a push action on the history stack: clicking a link or submitting a form, etc.
21-
- **REPLACE**: The user came to the current page via a replace action on the history stack: clicking a link with `<Link replace>`, submitting a form with `<Form replace>` or calling `navigate(to, { replace: true })`, etc.
21+
- **REPLACE**: The user came to the current page via a `replace` action on the history stack: clicking a link with `<Link replace>`, submitting a form with `<Form replace>` or calling `navigate(to, { replace: true })`, etc.
2222
- **POP**: The user came to the current page via a pop action on the history stack: clicking the back or forward button, calling `navigate(-1)` or `navigate(1)`, etc.
2323

2424
## Additional Resources

docs/hooks/use-navigation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ This tells you what the next location is going to be.
6262

6363
### `navigation.state`
6464

65-
- **idle** - There is no navigation pending.
66-
- **submitting** - A route action is being called due to a form submission using POST, PUT, PATCH, or DELETE
67-
- **loading** - The loaders for the next routes are being called to render the next page
65+
- **idle** There is no navigation pending.
66+
- **submitting** A route action is being called due to a form submission using POST, PUT, PATCH, or DELETE
67+
- **loading** The loaders for the next routes are being called to render the next page
6868

6969
Normal navigations and GET form submissions transition through these states:
7070

0 commit comments

Comments
 (0)