|
1 | 1 | # `@remix-run/router`
|
2 | 2 |
|
| 3 | +## 1.1.0-pre.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- Support for optional path segments ([#9650](https://github.com/remix-run/react-router/pull/9650)) |
| 8 | + - You can now denote optional path segments with a `?` as the last character in a path segment |
| 9 | + - Optional params examples |
| 10 | + - `:lang?/about` will get expanded and match: |
| 11 | + - `/:lang/about` |
| 12 | + - `/about` |
| 13 | + - `/multistep/:widget1?/widget2?/widget3?` will get expanded and match: |
| 14 | + - `/multistep/:widget1/:widget2/:widget3` |
| 15 | + - `/multistep/:widget1/:widget2` |
| 16 | + - `/multistep/:widget1` |
| 17 | + - `/multistep` |
| 18 | + - Optional static segment example |
| 19 | + - `/fr?/about` will get expanded and match: |
| 20 | + - `/fr/about` |
| 21 | + - `/about` |
| 22 | + |
| 23 | +### Patch Changes |
| 24 | + |
| 25 | +- 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)) |
| 26 | + |
| 27 | +```jsx |
| 28 | +// Old behavior at URL /prefix-123 |
| 29 | +<Route path="prefix-:id" element={<Comp /> }> |
| 30 | + |
| 31 | +function Comp() { |
| 32 | + let params = useParams(); // { id: '123' } |
| 33 | + let id = params.id; // "123" |
| 34 | + ... |
| 35 | +} |
| 36 | + |
| 37 | +// New behavior at URL /prefix-123 |
| 38 | +<Route path=":id" element={<Comp /> }> |
| 39 | + |
| 40 | +function Comp() { |
| 41 | + let params = useParams(); // { id: 'prefix-123' } |
| 42 | + let id = params.id.replace(/^prefix-/, ''); // "123" |
| 43 | + ... |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +- Fix requests sent to revalidating loaders so they reflect a GET request ([#9660](https://github.com/remix-run/react-router/pull/9660)) |
| 48 | +- Persist `headers` on `loader` `request`'s after SSR document `action` request ([#9721](https://github.com/remix-run/react-router/pull/9721)) |
| 49 | +- `GET` forms now expose a submission on the loading navigation ([#9695](https://github.com/remix-run/react-router/pull/9695)) |
| 50 | +- Fix error boundary tracking for multiple errors bubbling to the same boundary ([#9702](https://github.com/remix-run/react-router/pull/9702)) |
| 51 | + |
3 | 52 | ## 1.0.5
|
4 | 53 |
|
5 | 54 | ### Patch Changes
|
|
0 commit comments