Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from jacob-ebey/patch-1
Browse files Browse the repository at this point in the history
Updated to support generics for the match params.
  • Loading branch information
quisido authored Nov 14, 2018
2 parents af676cd + 7682913 commit 64b821e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/use-react-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ interface VoidFunction {
(): void;
}

const useRouter: UseRouter = (): RouteComponentProps<{}> => {
const useRouter: UseRouter = <T = {}>(): RouteComponentProps<T> => {
const forceUpdate: VoidFunction = useForceUpdate();
const routerContext: RouteComponentProps<{}> = useContext(__RouterContext);
const routerContext: RouteComponentProps<T> = useContext(__RouterContext);
useEffect(
(): VoidFunction =>
routerContext.history.listen(forceUpdate),
Expand Down

0 comments on commit 64b821e

Please sign in to comment.