Skip to content

Commit 3f102fc

Browse files
committed
docs: cleanup small grammar mistakes and make how-tos more similar
1 parent 9272911 commit 3f102fc

File tree

14 files changed

+36
-36
lines changed

14 files changed

+36
-36
lines changed

docs/explanation/race-conditions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ React Router's handling of network concurrency is heavily inspired by the behavi
1313
Consider clicking a link to a new document, and then clicking a different link before the new page has finished loading. The browser will:
1414

1515
1. cancel the first request
16-
2. immediately processes the new navigation
16+
2. immediately process the new navigation
1717

18-
This behavior includes form submissions. When a pending form submission is interrupted by a new one, the first is canceled and the new submission is immediately processed.
18+
The same behavior applies to form submissions. When a pending form submission is interrupted by a new one, the first is canceled and the new submission is immediately processed.
1919

2020
## React Router Behavior
2121

docs/explanation/type-safety.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: Type Safety
66

77
If you haven't done so already, check out our guide for [setting up type safety][route-module-type-safety] in a new project.
88

9-
React Router generates types for each route in your app that you can use to get type safety for each route module export.
9+
React Router generates types for each route in your app that provide type safety for the route module exports.
1010

1111
For example, let's say you have a `products/:id` route configured:
1212

docs/how-to/fetchers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default function Component() {
8080

8181
### 3. Submit the form
8282

83-
If you submit the form now, the fetcher call the action and revalidate the route data automatically.
83+
If you submit the form now, the fetcher will call the action and revalidate the route data automatically.
8484

8585
### 4. Render pending state
8686

@@ -299,4 +299,4 @@ Fetchers can be submitted programmatically with `fetcher.submit`:
299299
</fetcher.Form>
300300
```
301301

302-
Note the input event's form is passed as the first argument to `fetcher.submit`. The fetcher will use that form to submit the request, reading it's attributes and serializing the data from its elements.
302+
Note the input event's form is passed as the first argument to `fetcher.submit`. The fetcher will use that form to submit the request, reading its attributes and serializing the data from its elements.

docs/how-to/file-uploads.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ title: File Uploads
66

77
Handle file uploads in your React Router applications. This guide uses some packages from the [Remix The Web][remix-the-web] project to make file uploads easier.
88

9-
_Thank you to David Adams for [writing an original guide](https://programmingarehard.com/2024/09/06/remix-file-uploads-updated.html/) which this doc is based on. You can refer to it for even more examples._
9+
_Thank you to David Adams for [writing an original guide](https://programmingarehard.com/2024/09/06/remix-file-uploads-updated.html/) on which this doc is based. You can refer to it for even more examples._
1010

1111
## Basic File Upload
1212

13-
👉 **Setup some routes**
13+
### 1. Setup some routes
1414

1515
You can setup your routes however you like. This example uses the following structure:
1616

@@ -28,7 +28,7 @@ export default [
2828
] satisfies RouteConfig;
2929
```
3030

31-
👉 **Add the form data parser**
31+
### 2. Add the form data parser
3232

3333
`form-data-parser` is a wrapper around `request.formData()` that provides streaming support for handling file uploads.
3434

@@ -38,7 +38,7 @@ npm i @mjackson/form-data-parser
3838

3939
[See the `form-data-parser` docs for more information][form-data-parser]
4040

41-
👉 **Create a route with an upload action**
41+
### 3. Create a route with an upload action
4242

4343
The `parseFormData` function takes an `uploadHandler` function as an argument. This function will be called for each file upload in the form.
4444

@@ -83,7 +83,7 @@ export default function Component() {
8383

8484
## Local Storage Implementation
8585

86-
👉 **Add the storage package**
86+
### 1. Add the storage package
8787

8888
`file-storage` is a key/value interface for storing [File objects][file] in JavaScript. Similar to how `localStorage` allows you to store key/value pairs of strings in the browser, file-storage allows you to store key/value pairs of files on the server.
8989

@@ -93,7 +93,7 @@ npm i @mjackson/file-storage
9393

9494
[See the `file-storage` docs for more information][file-storage]
9595

96-
👉 **Create a storage configuration**
96+
### 2. Create a storage configuration
9797

9898
Create a file that exports a `LocalFileStorage` instance to be used by different routes.
9999

@@ -109,7 +109,7 @@ export function getStorageKey(userId: string) {
109109
}
110110
```
111111

112-
👉 **Implement the upload handler**
112+
### 3. Implement the upload handler
113113

114114
Update the form's `action` to store files in the `fileStorage` instance.
115115

@@ -177,7 +177,7 @@ export default function UserPage({
177177
}
178178
```
179179

180-
👉 **Add a route to serve the uploaded file**
180+
### 4. Add a route to serve the uploaded file
181181

182182
Create a [resource route][resource-route] that streams the file as a response.
183183

docs/how-to/headers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function loader({ params }: LoaderArgs) {
3939

4040
return data(page, {
4141
headers: {
42-
"Server-Timing': `page;dur=${ms};desc=`Page query"',
42+
"Server-Timing": `page;dur=${ms};desc="Page query"`,
4343
},
4444
});
4545
}

docs/how-to/pre-rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Pre-Rendering
44

55
# Pre-Rendering
66

7-
Pre-rendering allows you to render a pages at build time instead of on a server to speed up pages loads for static content.
7+
Pre-rendering allows you to render pages at build time instead of on a server to speed up pages loads for static content.
88

99
## Configuration
1010

docs/how-to/suspense.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Streaming with Suspense
44

55
# Streaming with Suspense
66

7-
Streaming with React Suspense allows apps to speed up initial renders by unblocking initial UI by deferring non-critical data.
7+
Streaming with React Suspense allows apps to speed up initial renders by deferring non-critical data and unblocking UI rendering.
88

99
React Router supports React Suspense by returning promises from loaders and actions.
1010

docs/how-to/view-transitions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Enable smooth animations between page transitions in your React Router applicati
88

99
## Basic View Transition
1010

11-
👉 **Enable view transitions on navigation**
11+
### 1. Enable view transitions on navigation
1212

1313
The simplest way to enable view transitions is by adding the `viewTransition` prop to your `Link`, `NavLink`, or `Form` components. This automatically wraps the navigation update in `document.startViewTransition()`.
1414

@@ -26,7 +26,7 @@ For more information on using the View Transitions API, please refer to the ["Sm
2626

2727
Let's build an image gallery that demonstrates how to trigger and use view transitions. We'll create a list of images that expand into a detail view with smooth animations.
2828

29-
👉 **Create the image gallery route**
29+
### 2. Create the image gallery route
3030

3131
```tsx filename=routes/image-gallery.tsx
3232
import { NavLink } from "react-router";
@@ -62,7 +62,7 @@ export default function ImageGalleryRoute() {
6262
}
6363
```
6464

65-
👉 **Add transition styles**
65+
### 3. Add transition styles
6666

6767
Define view transition names and animations for elements that should transition smoothly between routes.
6868

@@ -98,7 +98,7 @@ Define view transition names and animations for elements that should transition
9898
}
9999
```
100100

101-
👉 **Create the image detail route**
101+
### 4. Create the image detail route
102102

103103
The detail view needs to use the same view transition names to create a seamless animation.
104104

@@ -122,7 +122,7 @@ export default function ImageDetailsRoute({
122122
}
123123
```
124124

125-
👉 **Add matching transition styles for the detail view**
125+
### 5. Add matching transition styles for the detail view
126126

127127
```css filename=app.css
128128
/* Match transition names from the list view */
@@ -144,7 +144,7 @@ export default function ImageDetailsRoute({
144144

145145
You can control view transitions more precisely using either render props or the `useViewTransitionState` hook.
146146

147-
👉 **Using render props**
147+
### 1. Using render props
148148

149149
```tsx filename=routes/image-gallery.tsx
150150
<NavLink to={`/image/${idx}`} viewTransition>
@@ -172,7 +172,7 @@ You can control view transitions more precisely using either render props or the
172172
</NavLink>
173173
```
174174

175-
👉 **Using the `useViewTransitionState` hook**
175+
### 2. Using the `useViewTransitionState` hook
176176

177177
```tsx filename=routes/image-gallery.tsx
178178
function NavImage(props: { src: string; idx: number }) {

docs/start/framework/rendering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ There are three rendering strategies in React Router:
1313

1414
## Client Side Rendering
1515

16-
All routes are always client side rendered as the user navigates around the app. If you're looking to build a Single Page App, disable server rendering:
16+
Routes are always client side rendered as the user navigates around the app. If you're looking to build a Single Page App, disable server rendering:
1717

1818
```ts filename=react-router.config.ts
1919
import type { Config } from "@react-router/dev/config";
@@ -33,7 +33,7 @@ export default {
3333
} satisfies Config;
3434
```
3535

36-
Server side rendering requires a deployment that supports it. Though it's a global setting, individual routes can still be statically pre-rendered, and/or use client data loading with `clientLoader` to avoid server rendering/fetching of their portion of the UI.
36+
Server side rendering requires a deployment that supports it. Though it's a global setting, individual routes can still be statically pre-rendered. Routes can also use client data loading with `clientLoader` to avoid server rendering/fetching for their portion of the UI.
3737

3838
## Static Pre-rendering
3939

docs/start/framework/routing.md

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

88
## Configuring Routes
99

10-
Routes are configured in `app/routes.ts`. Routes have a url pattern to match the URL and a file path to the route module to define its behavior.
10+
Routes are configured in `app/routes.ts`. Each route has two required parts: a URL pattern to match the URL, and a file path to the route module that defines its behavior.
1111

1212
```ts filename=app/routes.ts
1313
import {

0 commit comments

Comments
 (0)