From 2fa7c93c1cbc9a01fa48aae29cdd4ce26afaa664 Mon Sep 17 00:00:00 2001 From: Sachin Rekhi Date: Wed, 8 Feb 2017 15:54:51 -0800 Subject: [PATCH] removed flex: 1 from SwipeableRow styles to make compatible with 0.39 changes Summary: React Native 0.39 introduced a breaking change through a new C-based implementation of css-layout. Developers were encouraged to remove unnecessary flex: 1 styles where no longer required to address any resulting layout issues. The SwipeableListView has not yet been updated to reflect this change. Specifically, SwipeableRow still sets flex: 1 even though it shouldn't. This was resulting in a rendering issue for folks when they upgraded to React Native 0.39 and used SwipeableListView that caused significant initial flickering when rendering a SwipeableListView. The solution was simply to remove flex: 1 from the SwipeableRow implementation. This small change removes flex: 1 to resolve this issue. Suggested reviewer (initial SwipeableListView contributor): fred2028 See this issue for more details: https://github.com/facebook/react-native/issues/11441 Closes https://github.com/facebook/react-native/pull/11521 Differential Revision: D4532562 Pulled By: lacker fbshipit-source-id: 5c2907186d00481a731bd81794947a019465a031 --- Libraries/Experimental/SwipeableRow/SwipeableRow.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Libraries/Experimental/SwipeableRow/SwipeableRow.js b/Libraries/Experimental/SwipeableRow/SwipeableRow.js index 283e847d2..eead0ee38 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableRow.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableRow.js @@ -189,12 +189,7 @@ const SwipeableRow = React.createClass({ const swipeableView = ( + style={{transform: [{translateX: this.state.currentLeft}]}}> {this.props.children} ); @@ -394,9 +389,6 @@ const styles = StyleSheet.create({ right: 0, top: 0, }, - swipeableContainer: { - flex: 1, - }, }); module.exports = SwipeableRow;