Skip to content

Commit 930def1

Browse files
committed
Tab can be changed programmaticly from the caller
1 parent 40e8115 commit 930def1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ var ScrollableTabView = React.createClass({
3737
};
3838
},
3939

40+
componentWillReceiveProps(props) {
41+
if (props.initialPage !== this.state.currentPage) {
42+
this.goToPage(props.initialPage);
43+
}
44+
},
45+
4046
goToPage(pageNumber) {
4147
this.props.onChangeTab && this.props.onChangeTab({
4248
i: pageNumber, ref: this.props.children[pageNumber]

0 commit comments

Comments
 (0)