Skip to content

Commit

Permalink
Remove generics from typescript useKeypress function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dahan committed Mar 10, 2019
1 parent 3e77130 commit 55c5c55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export type Instance = {

export type Unmount = () => void;

export function useKeypress<T extends (str?: string, key?: Key) => null>(keyPresshandler: T): null;
/**
* Hook that calls keyPressHandler callback with whatever key has been pressed.
* See key to handle modifiers correctly.
*/
export function useKeypress(
keyPressHandler: (str?: string, key?: Key) => void
): void;

/**
* Mount a component and render the output.
Expand Down

0 comments on commit 55c5c55

Please sign in to comment.