Skip to content

Commit

Permalink
feat: 下划线优化
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyair committed Nov 30, 2023
1 parent 4800c58 commit b30a2d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/useWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ function useWatch(
const { registerWatch } = getInternalHooks(HOOK_MARK);

const getNewValue = (values: any, allValues: any) => {
const _values = options.preserve ? allValues : values;
const newValues = options.preserve ? allValues : values;
return typeof dependencies === 'function'
? dependencies(_values)
: getValue(_values, namePathRef.current);
? dependencies(newValues)
: getValue(newValues, namePathRef.current);
};

const cancelRegister = registerWatch((values, allValues) => {
Expand Down

0 comments on commit b30a2d4

Please sign in to comment.