From d2804fba5b25bdbf43d43c54ebfec1f8a0e48de3 Mon Sep 17 00:00:00 2001 From: ALiaoo Date: Tue, 11 May 2021 15:06:10 +0800 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix "Invariant Violation: Maximum update depth exceeded..." bug #1049【ScrollableTabView设置了 page={activeTab}报的错】 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5996ff71..3b4c115d 100644 --- a/index.js +++ b/index.js @@ -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); } },