Skip to content

Commit

Permalink
fix: use lodash/includes replace Array.porototype.includes in Trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Dec 10, 2021
1 parent d0d26ac commit e048c3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/zarm/src/trigger/trigger.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import includes from 'lodash/includes';
import PropsType, { InstanceFn } from './PropsType';

class Trigger extends Component<PropsType, {}> {
Expand All @@ -14,7 +15,7 @@ class Trigger extends Component<PropsType, {}> {
const { visible, onClose, disabled } = nextProps;
onClose && (onClose.disabled = disabled);
if (visible === true && typeof onClose === 'function') {
if (!Trigger.instanceList.includes(onClose)) {
if (!includes(Trigger.instanceList, onClose)) {
Trigger.instanceList.push(onClose);
}
} else {
Expand Down

0 comments on commit e048c3d

Please sign in to comment.