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
@@ -150,8 +152,21 @@ To add a new release, copy from this template:
150
152
151
153
-->
152
154
155
+
## v6.20.1
156
+
157
+
### Patch Changes
158
+
159
+
- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see [#11052](https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329)) ([#11078](https://github.com/remix-run/react-router/pull/11078))
160
+
- We plan to re-introduce this fix behind a future flag in the next minor version (see [this comment](https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329))
161
+
- This fix was included in versions `6.19.0` and `6.20.0`. If you are upgrading from `6.18.0` or earlier, you would not have been impacted by this fix.
> Please use version `6.20.1` or later instead of `6.20.0`. We discovered that a large number of apps were relying on buggy behavior that was fixed in this release ([#11045](https://github.com/remix-run/react-router/pull/11045)). We reverted the fix in `6.20.1` and will be re-introducing it behind a future flag in a subsequent release. See [#11052](https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329) for more details.
169
+
155
170
### Minor Changes
156
171
157
172
- Export the `PathParam` type from the public API ([#10719](https://github.com/remix-run/react-router/pull/10719))
@@ -167,6 +182,9 @@ To add a new release, copy from this template:
167
182
168
183
## v6.19.0
169
184
185
+
> [!WARNING]
186
+
> Please use version `6.20.1` or later instead of `6.19.0`. We discovered that a large number of apps were relying on buggy behavior that was fixed in this release ([#10983](https://github.com/remix-run/react-router/pull/10983)). We reverted the fix in `6.20.1` and will be re-introducing it behind a future flag in a subsequent release. See [#11052](https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329) for more details.
187
+
170
188
### What's Changed
171
189
172
190
#### `unstable_flushSync` API
@@ -509,7 +527,7 @@ We recommend folks adopt this flag sooner rather than later to be better compati
509
527
510
528
## v6.12.1
511
529
512
-
> **Warning**
530
+
> [!WARNING]
513
531
> Please use version `6.13.0` or later instead of `6.12.0`/`6.12.1`. These versions suffered from some Webpack build/minification issues resulting failed builds or invalid minified code in your production bundles. See [#10569](https://github.com/remix-run/react-router/pull/10569) and [#10579](https://github.com/remix-run/react-router/issues/10579) for more details.
514
532
515
533
### Patch Changes
@@ -520,7 +538,7 @@ We recommend folks adopt this flag sooner rather than later to be better compati
520
538
521
539
## v6.12.0
522
540
523
-
> **Warning**
541
+
> [!WARNING]
524
542
> Please use version `6.13.0` or later instead of `6.12.0`/`6.12.1`. These versions suffered from some Webpack build/minification issues resulting failed builds or invalid minified code in your production bundles. See [#10569](https://github.com/remix-run/react-router/pull/10569) and [#10579](https://github.com/remix-run/react-router/issues/10579) for more details.
Copy file name to clipboardExpand all lines: docs/hooks/use-navigation.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ function SomeComponent() {
27
27
navigation.text;
28
28
navigation.formAction;
29
29
navigation.formMethod;
30
+
navigation.formEncType;
30
31
}
31
32
```
32
33
@@ -108,6 +109,45 @@ This tells you what the next [location][location] is going to be.
108
109
109
110
Note that this link will not appear "pending" if a form is being submitted to the URL the link points to, because we only do this for "loading" states. The form will contain the pending UI for when the state is "submitting", once the action is complete, then the link will go pending.
110
111
112
+
## `navigation.formAction`
113
+
114
+
Any POST, PUT, PATCH, or DELETE navigation that started from a `<Form>` or `useSubmit` will have form's submission action route's path value available in `navigation.formAction`.
115
+
116
+
In the case of a GET form submission, `navigation.formAction` will be empty
117
+
118
+
If you submitted the form at `example.com/id`, then `navigation.formAction` would be "/id"
119
+
120
+
## `navigation.formMethod`
121
+
122
+
Any POST, PUT, PATCH, or DELETE navigation that started from a `<Form>` or `useSubmit` will have form's submission method value available in `navigation.formMethod`.
123
+
124
+
In the case of a GET form submission, `navigation.formMethod` will be empty
125
+
126
+
Here is an example. Please note that `navigation.formMethod` is in lowercase
127
+
128
+
```tsx
129
+
function SubmitButton() {
130
+
const navigation =useNavigation();
131
+
if (navigation.formMethod) {
132
+
console.log(navigation.formMethod); // post
133
+
}
134
+
135
+
return (
136
+
<Formmethod="POST">
137
+
<button>Submit</button>
138
+
</Form>
139
+
);
140
+
}
141
+
```
142
+
143
+
## `navigation.formEncType`
144
+
145
+
Any POST, PUT, PATCH, or DELETE navigation that started from a `<Form>` or `useSubmit` will have form's submission method value available in `navigation.formEncType`.
146
+
147
+
This property can be one of the four values: "text/plain," "application/json," "multipart/form-data," or "application/x-www-form-urlencoded."
148
+
149
+
In the case of a GET form submission, `navigation.formEncType` will be empty
Copy file name to clipboardExpand all lines: packages/react-router-dom/CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,14 @@
1
1
# `react-router-dom`
2
2
3
+
## 6.20.1
4
+
5
+
### Patch Changes
6
+
7
+
- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
> Please use version `6.13.0` or later instead of `6.12.1`. This version suffers from a `webpack`/`terser` minification issue resulting in invalid minified code in your resulting production bundles which can cause issues in your application. See [#10579](https://github.com/remix-run/react-router/issues/10579) for more details.
0 commit comments