Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: align types with React Router #7319

Merged
merged 10 commits into from
Sep 6, 2023
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Michaël De Boey <info@michaeldeboey.be>
  • Loading branch information
brophdawg11 and MichaelDeBoey committed Sep 5, 2023
commit 7ba1b382160a2edda9dac235b01cefdf6aa48964
3 changes: 2 additions & 1 deletion .changeset/align-rr-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"@remix-run/cloudflare": major
"@remix-run/deno": major
"@remix-run/node": major
"@remix-run/react": major
"@remix-run/server-runtime": major
brophdawg11 marked this conversation as resolved.
Show resolved Hide resolved
---

Expand All @@ -16,5 +17,5 @@ Remove/align Remix types with those used in React Router
* `useMatches()[i].handle` type changed from `{ [k: string]: any }` to `unknown`
* `AppLoadContext` type changed from `{ [k: string]: unknown }` to `unknown`
* Make `LoaderFunctionArgs`/`ActionFunctionArgs` generic to accept a `context` type
* Rename `LoaderFunction`/`ActionFunction` to `LoaderFunctionArgs`/`ActionFunctionArgs`
* Rename `LoaderArgs`/`ActionArgs` to `LoaderFunctionArgs`/`ActionFunctionArgs`
* Rename the `useMatches()` return type from `RouteMatch` to `UIMatch`
2 changes: 1 addition & 1 deletion packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ export interface UIMatch<D = AppData> extends UIMatchRR<SerializeFrom<D>> {}
* Returns the active route matches, useful for accessing loaderData for
* parent/child routes or the route "handle" property
*
* @see https://remix.run/docs/hooks/use-matches
* @see https://remix.run/hooks/use-matches
*/
export function useMatches(): UIMatch[] {
return useMatchesRR() as UIMatch[];
Expand Down
Loading