From 545b7bbcb26ba60eb492bdaf81484006ef9998b9 Mon Sep 17 00:00:00 2001 From: Robby6Strings Date: Mon, 1 Apr 2024 07:59:05 +1300 Subject: [PATCH] useCallback now properly caches deps --- packages/lib/src/hooks/useCallback.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/lib/src/hooks/useCallback.ts b/packages/lib/src/hooks/useCallback.ts index e5df0d64..fc641ee7 100644 --- a/packages/lib/src/hooks/useCallback.ts +++ b/packages/lib/src/hooks/useCallback.ts @@ -8,6 +8,7 @@ export function useCallback any>( return useHook("useCallback", { callback, deps }, ({ hook, oldHook }) => { if (depsRequireChange(deps, oldHook?.deps)) { + hook.deps = deps hook.callback = callback } return hook.callback