@@ -13,6 +13,8 @@ We manage release notes in this file instead of the paginated Github Releases Pa
13
13
<summary>Table of Contents</summary>
14
14
15
15
- [React Router Releases](#react-router-releases)
16
+ - [v7.6.2](#v762)
17
+ - [Patch Changes](#patch-changes)
16
18
- [v7.6.1](#v761)
17
19
- [Patch Changes](#patch-changes)
18
20
- [Unstable Changes](#unstable-changes)
@@ -337,6 +339,78 @@ Date: YYYY-MM-DD
337
339
**Full Changelog**: [`v7.X.Y...v7.X.Y`](https://github.com/remix-run/react-router/compare/
[email protected] @7.X.Y)
338
340
-->
339
341
342
+ ## v7.6.2
343
+
344
+ Date: 2025-06-03
345
+
346
+ ### Patch Changes
347
+
348
+ - `create-react-router` - Update `tar-fs` ([#13675](https://github.com/remix-run/react-router/pull/13675))
349
+ - `react-router` - (INTERNAL) Slight refactor of internal `headers()` function processing for use with RSC ([#13639](https://github.com/remix-run/react-router/pull/13639))
350
+ - `react-router` `@react-router/dev` - Avoid additional `with-props` chunk in Framework Mode by moving route module component prop logic from the Vite plugin to `react-router` ([#13650](https://github.com/remix-run/react-router/pull/13650))
351
+ - `@react-router/dev` - When `future.unstable_viteEnvironmentApi` is enabled and an absolute Vite `base` has been configured, ensure critical CSS is handled correctly during development ([#13598](https://github.com/remix-run/react-router/pull/13598))
352
+ - `@react-router/dev` - Update `vite-node` ([#13673](https://github.com/remix-run/react-router/pull/13673))
353
+ - `@react-router/dev` - Fix typegen for non-{.js,.jsx,.ts,.tsx} routes like .mdx ([#12453](https://github.com/remix-run/react-router/pull/12453))
354
+ - `@react-router/dev` - Fix href types for optional dynamic params ([#13725](https://github.com/remix-run/react-router/pull/13725))
355
+
356
+ 7.6.1 introduced fixes for `href` when using optional static segments,
357
+ but those fixes caused regressions with how optional dynamic params worked in 7.6.0:
358
+
359
+ ```ts
360
+ // 7.6.0
361
+ href("/users/:id?"); // ✅
362
+ href("/users/:id?", { id: 1 }); // ✅
363
+
364
+ // 7.6.1
365
+ href("/users/:id?"); // ❌
366
+ href("/users/:id?", { id: 1 }); // ❌
367
+ ```
368
+
369
+ Now, optional static segments are expanded into different paths for `href`, but optional dynamic params are not.
370
+ This way `href` can unambiguously refer to an exact URL path, all while keeping the number of path options to a minimum.
371
+
372
+ ```ts
373
+ // 7.6.2
374
+
375
+ // path: /users/:id?/edit?
376
+ href("
377
+ // ^ suggestions when cursor is here:
378
+ //
379
+ // /users/:id?
380
+ // /users/:id?/edit
381
+ ```
382
+
383
+ Additionally, you can pass `params` from component props without needing to narrow them manually:
384
+
385
+ ```ts
386
+ declare const params: { id?: number };
387
+
388
+ // 7.6.0
389
+ href("/users/:id?", params);
390
+
391
+ // 7.6.1
392
+ href("/users/:id?", params); // ❌
393
+ "id" in params ? href("/users/:id", params) : href("/users"); // works... but is annoying
394
+
395
+ // 7.6.2
396
+ href("/users/:id?", params); // restores behavior of 7.6.0
397
+ ```
398
+
399
+ ### Changes by Package
400
+
401
+ - [`create-react-router`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/create-react-router/CHANGELOG.md#762)
402
+ - [`react-router`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router/CHANGELOG.md#762)
403
+ - [`@react-router/architect`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-architect/CHANGELOG.md#762)
404
+ - [`@react-router/cloudflare`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-cloudflare/CHANGELOG.md#762)
405
+ - [`@react-router/dev`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-dev/CHANGELOG.md#762)
406
+ - [`@react-router/express`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-express/CHANGELOG.md#762)
407
+ - [`@react-router/fs-routes`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-fs-routes/CHANGELOG.md#762)
408
+ - [`@react-router/node`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-node/CHANGELOG.md#762)
409
+ - [`@react-router/remix-config-routes-adapter`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-remix-config-routes-adapter/CHANGELOG.md#762)
410
+ - [`@react-router/serve`](https://github.com/remix-run/react-router/blob/react-router%407.6.2/packages/react-router-serve/CHANGELOG.md#762)
411
+
412
+ **Full Changelog**: [`v7.6.1...v7.6.2`](https://github.com/remix-run/react-router/compare/
[email protected] @7.6.2)
413
+
340
414
## v7.6.1
341
415
342
416
Date: 2025-05-25
0 commit comments