Skip to content

Commit

Permalink
fix(form): fix form useWatch (#2853)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaixingOoO authored Apr 22, 2024
1 parent 7cb1712 commit 555036f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/form/hooks/useWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default function useWatch(name: NamePath, form: InternalFormInstance) {

const { registerWatch = noop } = form.getInternalHooks?.(HOOK_MARK);

const cancelRegister = registerWatch(() => {
const cancelRegister = registerWatch((_values, paths) => {
if (String(name) !== String(paths)) return;
const allFieldsValue = form.getFieldsValue?.(true);
const newValue = get(allFieldsValue, name);
const nextValueStr = JSON.stringify(newValue);
Expand Down

0 comments on commit 555036f

Please sign in to comment.