Skip to content

Commit 1dc82f4

Browse files
committed
Let's not put this in componentWillReceiveProps
1 parent d6c5372 commit 1dc82f4

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

multi-picker.ios.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,10 @@ var MultiPickerIOS = React.createClass({
2222
},
2323

2424
getInitialState() {
25-
return this._stateFromProps(this.props);
26-
},
27-
28-
componentWillReceiveProps(nextProps) {
29-
this.setState(this._stateFromProps(nextProps));
30-
},
31-
32-
// converts child PickerComponent and their Item children into state
33-
// that can be sent to RNMultiPicker native class.
34-
_stateFromProps: function (props) {
3525
var componentData = [];
3626
var selectedIndexes = [];
3727

38-
React.Children.forEach(props.children, (child, index) => {
28+
React.Children.forEach(this.props.children, (child, index) => {
3929
var items = []
4030

4131
var selectedIndex = 0;

0 commit comments

Comments
 (0)