修复 Picker 无限拉取的问题

This commit is contained in:
2betop 2020-03-16 18:01:57 +08:00
parent 9a80e7e0ad
commit be397a2dd2
1 changed files with 3 additions and 2 deletions

View File

@ -9,7 +9,8 @@ import {
autobind,
getVariable,
noop,
createObject
createObject,
isObjectShallowModified
} from '../../utils/helper';
import findIndex from 'lodash/findIndex';
import Html from '../../components/Html';
@ -85,7 +86,7 @@ export default class PickerControl extends React.PureComponent<
componentDidUpdate(prevProps: PickerProps) {
const props = this.props;
if (props.value !== prevProps.value) {
if (JSON.stringify(props.value) !== JSON.stringify(prevProps.value)) {
this.fetchOptions();
}
}