You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/form.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Form
6
6
7
7
A progressively enhanced HTML [`<form>`][form_element] that submits data to actions via `fetch`, activating pending states in `useNavigation` which enables advanced user interfaces beyond a basic HTML form. After a form's action completes, all data on the page is automatically revalidated from the server to keep the UI in sync with the data.
8
8
9
-
Because it uses the HTML form API, serverrendered pages are interactive at a basic level before JavaScript loads. Instead of Remix managing the submission, the browser manages the submission as well as the pending states (like the spinning favicon). After JavaScript loads, Remix takes over enabling web application user experiences.
9
+
Because it uses the HTML form API, server-rendered pages are interactive at a basic level before JavaScript loads. Instead of Remix managing the submission, the browser manages the submission as well as the pending states (like the spinning favicon). After JavaScript loads, Remix takes over enabling web application user experiences.
10
10
11
11
Form is most useful for submissions that should also change the URL or otherwise add an entry to the browser history stack. For forms that shouldn't manipulate the browser history stack, use [`<fetcher.Form>`][fetcher_form].
12
12
@@ -79,7 +79,7 @@ If you are using [`<ScrollRestoration>`][scroll_restoration_component], this let
79
79
80
80
### `replace`
81
81
82
-
Replaces the current entry in the history stack, instead of pushing the new entry.
82
+
Replaces the current entry in the history stack instead of pushing the new entry.
Copy file name to clipboardExpand all lines: docs/components/prefetch-page-links.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ toc: false
5
5
6
6
# `<PrefetchPageLinks />`
7
7
8
-
This component enables prefetching of all assets for a page to enable an instant navigation to that page. It does this by rendering `<link rel="prefetch">` and `<link rel="modulepreload"/>` tags for all the assets (data, modules, css) of a given page.
8
+
This component enables prefetching of all assets for a page to enable an instant navigation to that page. It does this by rendering `<link rel="prefetch">` and `<link rel="modulepreload"/>` tags for all the assets (data, modules, CSS) of a given page.
9
9
10
10
`<Link rel="prefetch">` uses this internally, but you can render it to prefetch a page for any other reason.
Copy file name to clipboardExpand all lines: docs/components/scroll-restoration.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Optional. Defines the key used to restore scroll positions.
46
46
47
47
<summary>Discussion</summary>
48
48
49
-
Using `location.key` emulates the browser's default behavior. The user can navigate to the same URL multiple times in the stack and each entry gets its own scroll position to restore.
49
+
Using `location.key` emulates the browser's default behavior. The user can navigate to the same URL multiple times in the stack, and each entry gets its own scroll position to restore.
50
50
51
51
Some apps may want to override this behavior and restore position based on something else. Consider a social app that has four primary pages:
52
52
@@ -55,7 +55,7 @@ Some apps may want to override this behavior and restore position based on somet
55
55
- "/notifications"
56
56
- "/search"
57
57
58
-
If the user starts at "/home", scrolls down a bit, clicks "messages" in the navigation menu, then clicks "home" in the navigation menu (not the back button!) there will be three entries in the history stack:
58
+
If the user starts at `"/home"`, scrolls down a bit, clicks `"messages"` in the navigation menu, then clicks `"home"` in the navigation menu (not the back button!) there will be three entries in the history stack:
59
59
60
60
```
61
61
1. /home
@@ -65,7 +65,7 @@ If the user starts at "/home", scrolls down a bit, clicks "messages" in the navi
65
65
66
66
By default, React Router (and the browser) will have two different scroll positions stored for `1` and `3` even though they have the same URL. That means as the user navigated from `2` → `3` the scroll position goes to the top instead of restoring to where it was in `1`.
67
67
68
-
A solid product decision here is to keep the users scroll position on the home feed no matter how they got there (back button or new link clicks). For this, you'd want to use the `location.pathname` as the key.
68
+
A solid product decision here is to keep the users' scroll position on the home feed no matter how they got there (back button or new link clicks). For this, you'd want to use the `location.pathname` as the key.
69
69
70
70
```tsx
71
71
<ScrollRestoration
@@ -75,7 +75,7 @@ A solid product decision here is to keep the users scroll position on the home f
75
75
/>
76
76
```
77
77
78
-
Or you may want to only use the pathname for some paths, and use the normal behavior for everything else:
78
+
Or you may want to only use the pathname for some paths and use the normal behavior for everything else:
0 commit comments