From f3169cd351021300deda765b71ba7cfb72e49986 Mon Sep 17 00:00:00 2001 From: Elkin Torres Date: Mon, 28 Oct 2019 16:00:35 -0500 Subject: [PATCH] Fix componentDidUpdate condition to prevent infinite updates --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 82e53c54..c18e54c0 100644 --- a/index.js +++ b/index.js @@ -119,7 +119,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); } }, @@ -339,7 +339,7 @@ const ScrollableTabView = createReactClass({ if (!width || width <= 0 || Math.round(width) === Math.round(this.state.containerWidth)) { return; } - + if (Platform.OS === 'ios') { const containerWidthAnimatedValue = new Animated.Value(width); // Need to call __makeNative manually to avoid a native animated bug. See