react-router-dom 6.14.0-pre.1 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,25 +1,17 @@
1
1
  # `react-router-dom`
2
2
 
3
- ## 6.14.0-pre.1
4
-
5
- ### Patch Changes
6
-
7
- - (Remove) Fix FormData submitter feature detection check ([#10627](https://github.com/remix-run/react-router/pull/10627))
8
- - Updated dependencies:
9
- - `react-router@6.14.0-pre.1`
10
-
11
- ## 6.14.0-pre.0
3
+ ## 6.14.0
12
4
 
13
5
  ### Minor Changes
14
6
 
15
- - 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](https://github.com/remix-run/react-router/pull/10413))
7
+ - 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](https://github.com/remix-run/react-router/pull/10413))
16
8
 
17
9
  ```jsx
18
10
  // The default behavior will still serialize as FormData
19
11
  function Component() {
20
12
  let navigation = useNavigation();
21
13
  let submit = useSubmit();
22
- submit({ key: "value" });
14
+ submit({ key: "value" }, { method: "post" });
23
15
  // navigation.formEncType => "application/x-www-form-urlencoded"
24
16
  // navigation.formData => FormData instance
25
17
  }
@@ -33,23 +25,25 @@
33
25
  ```js
34
26
  // Opt-into JSON encoding with `encType: "application/json"`
35
27
  function Component() {
28
+ let navigation = useNavigation();
36
29
  let submit = useSubmit();
37
- submit({ key: "value" }, { encType: "application/json" });
30
+ submit({ key: "value" }, { method: "post", encType: "application/json" });
38
31
  // navigation.formEncType => "application/json"
39
32
  // navigation.json => { key: "value" }
40
33
  }
41
34
 
42
35
  async function action({ request }) {
43
36
  // request.headers.get("Content-Type") => "application/json"
44
- // await request.json => { key: "value" }
37
+ // await request.json() => { key: "value" }
45
38
  }
46
39
  ```
47
40
 
48
41
  ```js
49
- // Opt-into JSON encoding with `encType: "application/json"`
42
+ // Opt-into text encoding with `encType: "text/plain"`
50
43
  function Component() {
44
+ let navigation = useNavigation();
51
45
  let submit = useSubmit();
52
- submit("Text submission", { encType: "text/plain" });
46
+ submit("Text submission", { method: "post", encType: "text/plain" });
53
47
  // navigation.formEncType => "text/plain"
54
48
  // navigation.text => "Text submission"
55
49
  }
@@ -62,13 +56,16 @@
62
56
 
63
57
  ### Patch Changes
64
58
 
65
- - When submitting a form from a `submitter` element, prefer the built-in `new FormData(form, submitter)` instead of the previous manual approach in modern browsers (those that support the new `submitter` parameter). For browsers that don't support it, we continue to just append the submit button's entry to the end, and we also add rudimentary support for `type="image"` buttons. If developers want full spec-compliant support for legacy browsers, they can use the `formdata-submitter-polyfill`. ([#9865](https://github.com/remix-run/react-router/pull/9865))
66
- - upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
67
- - Call `window.history.pushState/replaceState` before updating React Router state (instead of after) so that `window.location` matches `useLocation` during synchronous React 17 rendering. However, generally apps should not be relying on `window.location` and should always reference `useLocation` when possible, as `window.location` will not be in sync 100% of the time (due to `popstate` events, concurrent mode, etc.) ([#10211](https://github.com/remix-run/react-router/pull/10211))
59
+ - When submitting a form from a `submitter` element, prefer the built-in `new FormData(form, submitter)` instead of the previous manual approach in modern browsers (those that support the new `submitter` parameter) ([#9865](https://github.com/remix-run/react-router/pull/9865), [#10627](https://github.com/remix-run/react-router/pull/10627))
60
+ - For browsers that don't support it, we continue to just append the submit button's entry to the end, and we also add rudimentary support for `type="image"` buttons
61
+ - If developers want full spec-compliant support for legacy browsers, they can use the `formdata-submitter-polyfill`
62
+ - Call `window.history.pushState/replaceState` before updating React Router state (instead of after) so that `window.location` matches `useLocation` during synchronous React 17 rendering ([#10448](https://github.com/remix-run/react-router/pull/10448))
63
+ - ⚠️ However, generally apps should not be relying on `window.location` and should always reference `useLocation` when possible, as `window.location` will not be in sync 100% of the time (due to `popstate` events, concurrent mode, etc.)
68
64
  - Fix `tsc --skipLibCheck:false` issues on React 17 ([#10622](https://github.com/remix-run/react-router/pull/10622))
65
+ - Upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
69
66
  - Updated dependencies:
70
- - `react-router@6.14.0-pre.0`
71
- - `@remix-run/router@1.7.0-pre.0`
67
+ - `react-router@6.14.0`
68
+ - `@remix-run/router@1.7.0`
72
69
 
73
70
  ## 6.13.0
74
71
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.14.0-pre.1
2
+ * React Router DOM v6.14.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.14.0-pre.1
2
+ * React Router DOM v6.14.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.14.0-pre.1
2
+ * React Router DOM v6.14.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.14.0-pre.1
2
+ * React Router DOM v6.14.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.14.0-pre.1
2
+ * React Router DOM v6.14.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.14.0-pre.1
2
+ * React Router DOM v6.14.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router-dom",
3
- "version": "6.14.0-pre.1",
3
+ "version": "6.14.0",
4
4
  "description": "Declarative routing for React web applications",
5
5
  "keywords": [
6
6
  "react",
@@ -23,8 +23,8 @@
23
23
  "module": "./dist/index.js",
24
24
  "types": "./dist/index.d.ts",
25
25
  "dependencies": {
26
- "@remix-run/router": "1.7.0-pre.0",
27
- "react-router": "6.14.0-pre.1"
26
+ "@remix-run/router": "1.7.0",
27
+ "react-router": "6.14.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "react": "^18.2.0",