Skip to content

Commit 0b06552

Browse files
committed
fix update props
1 parent e4ca97d commit 0b06552

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ export default class ModalPicker extends Component {
2222
}
2323

2424
componentWillReceiveProps( nextProps ) {
25-
this.setState({
25+
if(this.state.dataSource != nextProps.dataSource) {
26+
this.setState({
2627
dataSource: this.state.dataSource.cloneWithRows( nextProps.data )
27-
});
28+
});
29+
}
2830
}
2931

3032
setModalVisible(visible) {

0 commit comments

Comments
 (0)