From b30a2d4a4c3bb7190a2d0e403a7600bf117e6915 Mon Sep 17 00:00:00 2001 From: crazyair <645381995@qq.com> Date: Thu, 30 Nov 2023 10:03:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=8B=E5=88=92=E7=BA=BF=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/useWatch.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/useWatch.ts b/src/useWatch.ts index 39eed878..aebd3c14 100644 --- a/src/useWatch.ts +++ b/src/useWatch.ts @@ -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) => {