react-router 6.4.5 → 6.5.0-pre.1

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,5 +1,59 @@
1
1
  # `react-router`
2
2
 
3
+ ## 6.5.0-pre.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - `@remix-run/router@1.1.0-pre.1`
9
+
10
+ ## 6.5.0-pre.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Support for optional path segments ([#9650](https://github.com/remix-run/react-router/pull/9650))
15
+ - You can now denote optional path segments with a `?` as the last character in a path segment
16
+ - Optional params examples
17
+ - `:lang?/about` will get expanded and match:
18
+ - `/:lang/about`
19
+ - `/about`
20
+ - `/multistep/:widget1?/widget2?/widget3?` will get expanded and match:
21
+ - `/multistep/:widget1/:widget2/:widget3`
22
+ - `/multistep/:widget1/:widget2`
23
+ - `/multistep/:widget1`
24
+ - `/multistep`
25
+ - Optional static segment example
26
+ - `/fr?/about` will get expanded and match:
27
+ - `/fr/about`
28
+ - `/about`
29
+
30
+ ### Patch Changes
31
+
32
+ - Stop incorrectly matching on partial named parameters, i.e. `<Route path="prefix-:param">`, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at the `useParams` call site: ([#9506](https://github.com/remix-run/react-router/pull/9506))
33
+
34
+ ```jsx
35
+ // Old behavior at URL /prefix-123
36
+ <Route path="prefix-:id" element={<Comp /> }>
37
+
38
+ function Comp() {
39
+ let params = useParams(); // { id: '123' }
40
+ let id = params.id; // "123"
41
+ ...
42
+ }
43
+
44
+ // New behavior at URL /prefix-123
45
+ <Route path=":id" element={<Comp /> }>
46
+
47
+ function Comp() {
48
+ let params = useParams(); // { id: 'prefix-123' }
49
+ let id = params.id.replace(/^prefix-/, ''); // "123"
50
+ ...
51
+ }
52
+ ```
53
+
54
+ - Updated dependencies:
55
+ - `@remix-run/router@1.1.0-pre.0`
56
+
3
57
  ## 6.4.5
4
58
 
5
59
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.4.5
2
+ * React Router v6.5.0-pre.1
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 v6.4.5
2
+ * React Router v6.5.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.4.5
2
+ * React Router v6.5.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.4.5
2
+ * React Router v6.5.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.4.5
2
+ * React Router v6.5.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.4.5
2
+ * React Router v6.5.0-pre.1
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",
3
- "version": "6.4.5",
3
+ "version": "6.5.0-pre.1",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",
@@ -23,7 +23,7 @@
23
23
  "module": "./dist/index.js",
24
24
  "types": "./dist/index.d.ts",
25
25
  "dependencies": {
26
- "@remix-run/router": "1.0.5"
26
+ "@remix-run/router": "1.1.0-pre.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "react": "^18.2.0"