Browse Source

chore: remove unnecessary loop (#21978)

pull/21979/head
zefeng 5 years ago
committed by GitHub
parent
commit
be990f9332
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      components/form/FormItem.tsx

5
components/form/FormItem.tsx

@ -287,10 +287,7 @@ function FormItem(props: FormItemProps): React.ReactElement {
const childProps = { ...children.props, ...mergedControl };
// We should keep user origin event handler
const triggers = new Set<string>();
[...toArray(trigger), ...toArray(validateTrigger)].forEach(eventName => {
triggers.add(eventName);
});
const triggers = new Set<string>([...toArray(trigger), ...toArray(validateTrigger)]);
triggers.forEach(eventName => {
childProps[eventName] = (...args: any[]) => {

Loading…
Cancel
Save