Skip to content

Commit

Permalink
perf(useForm): If the args of the setFieldsValue is empty, it will no…
Browse files Browse the repository at this point in the history
…t be executed. close #3209
  • Loading branch information
wangjue666 committed Oct 30, 2023
1 parent 06a6c94 commit 8f90087
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Form/src/hooks/useFormEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export function useFormEvents({
* @description: Set form value
*/
async function setFieldsValue(values: Recordable): Promise<void> {
if (Object.keys(values).length === 0) {
return;
}

const fields = getAllFields();

// key 支持 a.b.c 的嵌套写法
Expand Down

0 comments on commit 8f90087

Please sign in to comment.