Skip to content

Commit

Permalink
bugfix: lib/useCallback - fix HMR invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
LankyMoose committed Nov 24, 2024
1 parent e381dd9 commit 80e5814
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lib/src/hooks/useCallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function useCallback<T extends Function>(
if (__DEV__) {
hook.debug = { get: () => ({ dependencies: hook.deps }) }
}
if (!isInit && depsRequireChange(deps, hook.deps)) {
if (isInit || depsRequireChange(deps, hook.deps)) {
hook.deps = deps
hook.callback = callback
}
Expand Down

0 comments on commit 80e5814

Please sign in to comment.