Add support for application/json and text/plain encodings for useSubmit/fetcher.submit. To reflect these additional types, useNavigation/useFetcher now also contain navigation.json/navigation.text and fetcher.json/fetcher.text which include the json/text submission if applicable (#10413)
// The default behavior will still serialize as FormData
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit({ key: "value" }, { method: "post" });
// navigation.formEncType => "application/x-www-form-urlencoded"
// navigation.formData => FormData instance
}
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.13.0 to 6.14.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/remix-run/react-router/releases">react-router-dom's releases</a>.</em></p>
<blockquote>
<h2>react-router-dom-v5-compat@6.4.0-pre.15</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.15</li>
<li>react-router-dom@6.4.0-pre.15</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.11</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.11</li>
<li>react-router-dom@6.4.0-pre.11</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.10</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.10</li>
<li>react-router-dom@6.4.0-pre.10</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.9</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.9</li>
<li>react-router-dom@6.4.0-pre.9</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.8</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.8</li>
<li>react-router-dom@6.4.0-pre.8</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.7</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li><code>react-router@6.4.0-pre.7</code></li>
<li><code>react-router-dom@6.4.0-pre.7</code></li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.6</h2>
<h3>Patch Changes</h3>
<ul>
<li>44bce3c6: Fix <code>react-router-dom</code> peer dependency version
<ul>
<li>react-router@6.4.0-pre.6</li>
<li>react-router-dom@6.4.0-pre.6</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.5</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/remix-run/react-router/blob/react-router-dom@6.14.0/packages/react-router-dom/CHANGELOG.md">react-router-dom's changelog</a>.</em></p>
<blockquote>
<h2>6.14.0</h2>
<h3>Minor Changes</h3>
<ul>
<li>
<p>Add support for <code>application/json</code> and <code>text/plain</code> encodings for <code>useSubmit</code>/<code>fetcher.submit</code>. To reflect these additional types, <code>useNavigation</code>/<code>useFetcher</code> now also contain <code>navigation.json</code>/<code>navigation.text</code> and <code>fetcher.json</code>/<code>fetcher.text</code> which include the json/text submission if applicable (<a href="https://redirect.github.com/remix-run/react-router/pull/10413">#10413</a>)</p>
<pre lang="jsx"><code>// The default behavior will still serialize as FormData
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit({ key: "value" }, { method: "post" });
// navigation.formEncType => "application/x-www-form-urlencoded"
// navigation.formData => FormData instance
}
<p>async function action({ request }) {
// request.headers.get("Content-Type") => "application/x-www-form-urlencoded"
// await request.formData() => FormData instance
}
</code></pre></p>
<pre lang="js"><code>// Opt-into JSON encoding with `encType: "application/json"`
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit({ key: "value" }, { method: "post", encType: "application/json" });
// navigation.formEncType => "application/json"
// navigation.json => { key: "value" }
}
async function action({ request }) {
// request.headers.get("Content-Type") => "application/json"
// await request.json() => { key: "value" }
}
</code></pre>
<pre lang="js"><code>// Opt-into text encoding with `encType: "text/plain"`
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit("Text submission", { method: "post", encType: "text/plain" });
// navigation.formEncType => "text/plain"
// navigation.text => "Text submission"
}
async function action({ request }) {
// request.headers.get("Content-Type") => "text/plain"
</code></pre>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/remix-run/react-router/commit/09b6cbeabb02ffaccc3d5a6ca751b9f5221b0d5b"><code>09b6cbe</code></a> chore: Update version for release (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/10636">#10636</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/9debb5c123d7ab9f9d15b6db4fc0fd9d7ea2a856"><code>9debb5c</code></a> Update changelogs</li>
<li><a href="https://github.com/remix-run/react-router/commit/d1bc7cf0af7c977103b7a1a7c1294d8dc8595b63"><code>d1bc7cf</code></a> Update changeset + chanbgelog</li>
<li><a href="https://github.com/remix-run/react-router/commit/6cbd0b148e9655f0a471c9f2445f49f343c52d21"><code>6cbd0b1</code></a> chore: Update version for release (pre) (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/10628">#10628</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/19a71df56ff6fde417cc80aa9394d1d5b63e1d72"><code>19a71df</code></a> fix FormData submitter check (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/10627">#10627</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/8b95f2b861feb5999b509d22318cd2384ab84dac"><code>8b95f2b</code></a> chore: Update version for release (pre) (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/10626">#10626</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/96e1fc1dcdcfd89930df1af4cf190f43c2a0f461"><code>96e1fc1</code></a> Inline startTransitionImpl to avoid .d.ts issues with skipLibCheck:false (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/10">#10</a>...</li>
<li><a href="https://github.com/remix-run/react-router/commit/f63774c3843e2f25b6ca5b6f4882ebd4db705603"><code>f63774c</code></a> fix(react-router-dom): fix submitter serialization (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/9865">#9865</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/a3b21eb301b336bfb7645ba11d8b96eed9fbefd6"><code>a3b21eb</code></a> Merge branch 'release-next' into dev</li>
<li><a href="https://github.com/remix-run/react-router/commit/834383b906234d71c079ff6122c8d733d51c5230"><code>834383b</code></a> Fix unstable_useBlocker key issues in strict mode (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/10573">#10573</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/remix-run/react-router/commits/react-router-dom@6.14.0/packages/react-router-dom">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bumps react-router-dom from 6.13.0 to 6.14.0.
Release notes
Sourced from react-router-dom's releases.
... (truncated)
Changelog
Sourced from react-router-dom's changelog.
... (truncated)
Commits
09b6cbechore: Update version for release (#10636)9debb5cUpdate changelogsd1bc7cfUpdate changeset + chanbgelog6cbd0b1chore: Update version for release (pre) (#10628)19a71dffix FormData submitter check (#10627)8b95f2bchore: Update version for release (pre) (#10626)96e1fc1Inline startTransitionImpl to avoid .d.ts issues with skipLibCheck:false (#10...f63774cfix(react-router-dom): fix submitter serialization (#9865)a3b21ebMerge branch 'release-next' into dev834383bFix unstable_useBlocker key issues in strict mode (#10573)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Deploying with
Cloudflare Pages
c60352dView logs