From 6690798e79a17bdc8dcd45b692075e1a63e565cb Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Fri, 16 Sep 2022 04:52:50 +0530 Subject: [PATCH] rm setNativeProps, pass style as a prop --- src/components/InvertedFlatList/index.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/InvertedFlatList/index.js b/src/components/InvertedFlatList/index.js index b92b27bd3449..f984ed989f08 100644 --- a/src/components/InvertedFlatList/index.js +++ b/src/components/InvertedFlatList/index.js @@ -36,17 +36,13 @@ class InvertedFlatList extends React.Component { this.props.innerRef(this.list); } - if (this.list) { - this.list - .getScrollableNode() - .addEventListener('wheel', this.invertedWheelEvent); - - this.list.setNativeProps({ - style: { - transform: 'translate3d(0,0,0) scaleY(-1)', - }, - }); + if (!this.list) { + return; } + + this.list + .getScrollableNode() + .addEventListener('wheel', this.invertedWheelEvent); } componentWillUnmount() { @@ -67,6 +63,7 @@ class InvertedFlatList extends React.Component { ref={el => this.list = el} shouldMeasureItems contentContainerStyle={StyleSheet.compose(this.props.contentContainerStyle, styles.justifyContentEnd)} + style={{transform: [{translateX: 0}, {translateY: 0}, {scaleY: -1}]}} /> ); }