Bump react-router to ^7.6.1
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| react-router (source) | ^7.6.0 -> ^7.6.1 |
Release Notes
remix-run/react-router (react-router)
v7.6.1
Patch Changes
-
Update
Route.MetaArgsto reflect thatdatacan be potentiallyundefined(#13563)This is primarily for cases where a route
loaderthrew an error to it's ownErrorBoundary. but it also arises in the case of a 404 which renders the rootErrorBoundary/metabut the root loader did not run because not routes matched. -
Partially revert optimization added in
7.1.4to reduce calls tomatchRoutesbecause it surfaced other issues (#13562) -
Fix typegen when same route is used at multiple paths (#13574)
For example,
routes/route.tsxis used at 4 different paths here:import { type RouteConfig, route } from "@​react-router/dev/routes"; export default [ route("base/:base", "routes/base.tsx", [ route("home/:home", "routes/route.tsx", { id: "home" }), route("changelog/:changelog", "routes/route.tsx", { id: "changelog" }), route("splat/*", "routes/route.tsx", { id: "splat" }), ]), route("other/:other", "routes/route.tsx", { id: "other" }), ] satisfies RouteConfig;Previously, typegen would arbitrarily pick one of these paths to be the "winner" and generate types for the route module based on that path. Now, typegen creates unions as necessary for alternate paths for the same route file.
-
Better types for
params(#13543)For example:
// routes.ts import { type RouteConfig, route } from "@​react-router/dev/routes"; export default [ route("parent/:p", "routes/parent.tsx", [ route("layout/:l", "routes/layout.tsx", [ route("child1/:c1a/:c1b", "routes/child1.tsx"), route("child2/:c2a/:c2b", "routes/child2.tsx"), ]), ]), ] satisfies RouteConfig;Previously,
paramsfor theroutes/layout.tsxroute were calculated as{ p: string, l: string }. This incorrectly ignores params that could come from child routes. If visiting/parent/1/layout/2/child1/3/4, the actual params passed toroutes/layout.tsxwill have a type of{ p: string, l: string, c1a: string, c1b: string }.Now,
paramsare aware of child routes and autocompletion will include child params as optionals:params.| // ^ cursor is here and you ask for autocompletion // p: string // l: string // c1a?: string // c1b?: string // c2a?: string // c2b?: stringYou can also narrow the types for
paramsas it is implemented as a normalized union of params for each page that includesroutes/layout.tsx:if (typeof params.c1a === 'string') { params.| // ^ cursor is here and you ask for autocompletion // p: string // l: string // c1a: string // c1b: string }
UNSTABLE: renamed internal
react-router/route-moduleexport toreact-router/internalUNSTABLE: removedInfoexport from generated+types/*files -
Avoid initial fetcher execution 404 error when Lazy Route Discovery is interrupted by a navigation (#13564)
-
href replaces splats
*(#13593)const a = href("/products/*", { "*": "/1/edit" }); // -> /products/1/edit
Configuration
📅 Schedule: Branch creation - "on sunday before 6:00am" in timezone UTC, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Deploy preview: https://deploy-preview-18162--material-ui-x.netlify.app/
Bundle size report
Total Size Change: 0B(0.00%) - Total Gzip Change: 0B(0.00%) Files: 120 total (0 added, 0 removed, 0 changed)
Generated by :no_entry_sign: dangerJS against b738a780ec5ee0742556fab3ca7fedc4c596ff62