Skip to content

Commit 91f97ba

Browse files
committed
Update docs
1 parent 8760827 commit 91f97ba

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/hooks/use-fetcher.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ function TaskCheckbox({ task }) {
203203
}
204204
```
205205

206+
If you opt-out of serialization using `encType:null`, then `fetcher.formData` will be `undefined` and your data will be exposed on `fetcher.payload`.
207+
206208
## `fetcher.formAction`
207209

208210
Tells you the action url the form is being submitted to.
@@ -227,6 +229,10 @@ fetcher.formMethod; // "post"
227229

228230
<docs-warning>The `fetcher.formMethod` field is lowercase without the `future.v7_normalizeFormMethod` [Future Flag][api-development-strategy]. This is being normalized to uppercase to align with the `fetch()` behavior in v7, so please upgrade your React Router v6 applications to adopt the uppercase HTTP methods.</docs-warning>
229231

232+
## `fetcher.payload`
233+
234+
Any POST, PUT, PATCH, or DELETE that started from a `fetcher.submit(payload, { encType: null })` will have your `payload` value represented in `fetcher.payload`.
235+
230236
[loader]: ../route/loader
231237
[action]: ../route/action
232238
[pickingarouter]: ../routers/picking-a-router

docs/hooks/use-navigation.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ let isRedirecting =
9191

9292
Any POST, PUT, PATCH, or DELETE navigation that started from a `<Form>` or `useSubmit` will have your form's submission data attached to it. This is primarily useful to build "Optimistic UI" with the `submission.formData` [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) object.
9393

94+
If you opt-out of serialization using `encType:null`, then `navigation.formData` will be `undefined` and your data will be exposed on `navigation.payload`.
95+
9496
In the case of a GET form submission, `formData` will be empty and the data will be reflected in `navigation.location.search`.
9597

9698
## `navigation.payload`
9799

98-
Any POST, PUT, PATCH, or DELETE navigation that started from a `useSubmit(payload, { encType: null })` will have your `payload` value represented on the navigation.
100+
Any POST, PUT, PATCH, or DELETE navigation that started from a `useSubmit(payload, { encType: null })` will have your `payload` value represented in `navigation.payload`.
99101

100102
## `navigation.location`
101103

0 commit comments

Comments
 (0)