Skip to content

Commit

Permalink
Add second generic to UIMatch for handle field
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Sep 18, 2023
1 parent e3d5b17 commit 6d44e50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/add-uimatch-handle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Add second generic to `UIMatch` for `handle` field
6 changes: 5 additions & 1 deletion packages/remix-react/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import type {
MetaDescriptor,
MetaMatch,
MetaMatches,
RouteHandle,
} from "./routeModules";

function useDataRouterContext() {
Expand Down Expand Up @@ -976,7 +977,10 @@ function dedupe(array: any[]) {
return [...new Set(array)];
}

export type UIMatch<D = AppData> = UIMatchRR<SerializeFrom<D>>;
export type UIMatch<D = AppData, H = RouteHandle> = UIMatchRR<
SerializeFrom<D>,
H
>;

/**
* Returns the active route matches, useful for accessing loaderData for
Expand Down

0 comments on commit 6d44e50

Please sign in to comment.