Skip to content

Commit

Permalink
fix TS errors when 'useParams' set to 'any (#3039)
Browse files Browse the repository at this point in the history
* fix TS errors when 'useParams' set to 'any

* chore: add changeset

Co-authored-by: Ömer Faruk APLAK <omer@refine.dev>
  • Loading branch information
alonp99 and omeraplak committed Nov 28, 2022
1 parent 38dfde0 commit 54eee29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sixty-suns-agree.md
@@ -0,0 +1,5 @@
---
"@pankod/refine-react-router-v6": patch
---

Fixed TypeScript type of `useParams` hook
2 changes: 1 addition & 1 deletion packages/react-router-v6/src/index.ts
Expand Up @@ -22,7 +22,7 @@ export type RefineRouteProps = RouteProps & {
interface IReactRouterProvider extends IRouterProvider {
useLocation: typeof useLocation;
Link: typeof Link;
useParams: any;
useParams: <Params extends { [K in keyof Params]?: string } = {}>() => Params;
RouterComponent: React.FC<BrowserRouterProps>;
routes?: RefineRouteProps[];
}
Expand Down

0 comments on commit 54eee29

Please sign in to comment.