Skip to content

Commit

Permalink
feat: add use-typescript-happy-callback
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Sep 8, 2024
1 parent 1e49d44 commit 5798367
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/use-typescript-happy-callback/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { useCallback as useCallbackFromReact } from 'react';

export const useTypeScriptHappyCallback: <Args extends unknown[], R>(
fn: (...args: Args) => R,
deps: React.DependencyList
) => (...args: Args) => R = useCallbackFromReact;
export const useCallback = useTypeScriptHappyCallback;

0 comments on commit 5798367

Please sign in to comment.