Skip to content

Commit d2804fb

Browse files
authored
Update index.js
Fix "Invariant Violation: Maximum update depth exceeded..." bug ptomasroos#1049【ScrollableTabView设置了 page={activeTab}报的错】
1 parent a7f46de commit d2804fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const ScrollableTabView = createReactClass({
120120
this.updateSceneKeys({ page: this.state.currentPage, children: this.props.children, });
121121
}
122122

123-
if (this.props.page >= 0 && this.props.page !== this.state.currentPage) {
123+
if (this.props.page !== prevProps.page && this.props.page >= 0 && this.props.page !== this.state.currentPage) {
124124
this.goToPage(this.props.page);
125125
}
126126
},

0 commit comments

Comments
 (0)