Skip to content

Commit ca2f77a

Browse files
authored
Merge pull request ptomasroos#378 from miguelsm/master
Prevent page change being reverted due to queued setState
2 parents 8bb656a + bbcbbfe commit ca2f77a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ const ScrollableTabView = React.createClass({
6666
},
6767

6868
componentWillReceiveProps(props) {
69-
if (props.page >= 0 && props.page !== this.state.currentPage) {
70-
this.goToPage(props.page);
71-
}
72-
7369
if (props.children !== this.props.children) {
7470
this.updateSceneKeys({ page: this.state.currentPage, children: props.children, });
7571
}
72+
73+
if (props.page >= 0 && props.page !== this.state.currentPage) {
74+
this.goToPage(props.page);
75+
}
7676
},
7777

7878
goToPage(pageNumber) {

0 commit comments

Comments
 (0)