Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
Fix "Invariant Violation: Maximum update depth exceeded..." bug ptomasroos#1049【ScrollableTabView设置了 page={activeTab}报的错】
  • Loading branch information
ALiaoo authored May 11, 2021
1 parent a7f46de commit d2804fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const ScrollableTabView = createReactClass({
this.updateSceneKeys({ page: this.state.currentPage, children: this.props.children, });
}

if (this.props.page >= 0 && this.props.page !== this.state.currentPage) {
if (this.props.page !== prevProps.page && this.props.page >= 0 && this.props.page !== this.state.currentPage) {
this.goToPage(this.props.page);
}
},
Expand Down

0 comments on commit d2804fb

Please sign in to comment.