Skip to content

Commit

Permalink
fix(): fixes willUpdate warnings (#2800)
Browse files Browse the repository at this point in the history
  • Loading branch information
sankhadeeproy007 authored Jul 23, 2019
1 parent e63adfc commit f71de0d
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"no-underscore-dangle": "off",
"no-unused-expressions": "off",
"react/jsx-filename-extension": "off",
"react/no-did-update-set-state": "off",
"react/prop-types": "off"
},
"plugins": ["react", "jsx-a11y", "import", "react-native"]
Expand Down
2 changes: 1 addition & 1 deletion src/basic/DeckSwiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class DeckSwiper extends Component {
});
}

componentWillUpdate({ dataSource }) {
componentDidUpdate({ dataSource }) {
if (dataSource.length !== this.props.dataSource.length) {
if (dataSource.length <= 1) {
this.setState({
Expand Down
2 changes: 1 addition & 1 deletion src/basic/IconNB.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IconNB extends Component {
this.setIcon(this.props.type);
}

componentWillUpdate(nextProps) {
componentDidUpdate(nextProps) {
if (nextProps.type && this.props.type !== nextProps.type) {
this.setIcon(nextProps.type);
}
Expand Down
2 changes: 1 addition & 1 deletion src/basic/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Item extends Component {
this.inputProps.getRef(this._inputRef);
}
}
componentWillUpdate(nextProps) {
componentDidUpdate(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);

_.remove(childrenArray, item => {
Expand Down
6 changes: 1 addition & 5 deletions src/basic/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ class List extends Component {
/>
);
}
return (
<View ref={c => (this._root = c)} {...this.props}>
{this.renderChildren()}
</View>
);
return <View ref={c => (this._root = c)} {...this.props} />;
}
}
const StyledList = connectStyle('NativeBase.List', {}, mapPropsToStyleNames)(
Expand Down
2 changes: 1 addition & 1 deletion src/basic/Picker.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PickerNB extends Component {
};
}

componentWillUpdate(nextProps) {
componentDidUpdate(nextProps) {
const currentLabel = this.state.currentLabel;
const nextLabel = this.getLabel(nextProps);
const currentDS = this.state.dataSource;
Expand Down
2 changes: 1 addition & 1 deletion src/basic/Tabs/ScrollableTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const ScrollableTabBar = createReactClass({
);
},

componentWillUpdate(nextProps) {
componentDidUpdate(nextProps) {
// If the tabs change, force the width of the tabs container to be recalculated
if (
!isEqual(this.props.tabs, nextProps.tabs) &&
Expand Down
2 changes: 1 addition & 1 deletion src/basic/Tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ScrollableTabView = createReactClass({
InteractionManager.runAfterInteractions(scrollFn);
},

componentWillUpdate(props) {
componentDidUpdate(props) {
if (props.children !== this.props.children) {
this.updateSceneKeys({
page: this.state.currentPage,
Expand Down

0 comments on commit f71de0d

Please sign in to comment.