Skip to content

Commit

Permalink
Update changeset + chanbgelog
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jun 21, 2023
1 parent 6cbd0b1 commit d1bc7cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .changeset/raw-payload-submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function action({ request }) {
```js
// Opt-into JSON encoding with `encType: "application/json"`
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit({ key: "value" }, { encType: "application/json" });
// navigation.formEncType => "application/json"
Expand All @@ -31,13 +32,14 @@ function Component() {

async function action({ request }) {
// request.headers.get("Content-Type") => "application/json"
// await request.json => { key: "value" }
// await request.json() => { key: "value" }
}
```

```js
// Opt-into JSON encoding with `encType: "application/json"`
// Opt-into text encoding with `encType: "text/plain"`
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit("Text submission", { encType: "text/plain" });
// navigation.formEncType => "text/plain"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
async function action({ request }) {
// request.headers.get("Content-Type") => "application/json"
// await request.json => { key: "value" }
// await request.json() => { key: "value" }
}
```

```js
// Opt-into JSON encoding with `encType: "application/json"`
// Opt-into text encoding with `encType: "text/plain"`
function Component() {
let submit = useSubmit();
submit("Text submission", { encType: "text/plain" });
Expand Down

0 comments on commit d1bc7cf

Please sign in to comment.