We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 583a66f commit 853ba8eCopy full SHA for 853ba8e
index.js
@@ -116,11 +116,15 @@ const ScrollableTabView = createReactClass({
116
},
117
118
componentDidUpdate(prevProps) {
119
+ const currentPage = this.state.currentPage;
120
if (this.props.children !== prevProps.children) {
- this.updateSceneKeys({ page: this.state.currentPage, children: this.props.children, });
121
+ if (currentPage >= props.children.length) {
122
+ currentPage = 0;
123
+ }
124
+ this.updateSceneKeys({ page: currentPage, children: props.children, });
125
}
126
- if (this.props.page >= 0 && this.props.page !== this.state.currentPage) {
127
+ if (this.props.page >= 0 && this.props.page !== currentPage) {
128
this.goToPage(this.props.page);
129
130
0 commit comments