Skip to content

Commit 900bb4a

Browse files
Merge pull request #11035 from rushatgabhane/rm-setNativeProps-invertedFlatList
InvertedFlatList - Migrate setNativeProps and pass style prop
2 parents f72fccf + 063da29 commit 900bb4a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/components/InvertedFlatList/index.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,13 @@ class InvertedFlatList extends React.Component {
3636
this.props.innerRef(this.list);
3737
}
3838

39-
if (this.list) {
40-
this.list
41-
.getScrollableNode()
42-
.addEventListener('wheel', this.invertedWheelEvent);
43-
44-
this.list.setNativeProps({
45-
style: {
46-
transform: 'translate3d(0,0,0) scaleY(-1)',
47-
},
48-
});
39+
if (!this.list) {
40+
return;
4941
}
42+
43+
this.list
44+
.getScrollableNode()
45+
.addEventListener('wheel', this.invertedWheelEvent);
5046
}
5147

5248
componentWillUnmount() {
@@ -67,6 +63,7 @@ class InvertedFlatList extends React.Component {
6763
ref={el => this.list = el}
6864
shouldMeasureItems
6965
contentContainerStyle={StyleSheet.compose(this.props.contentContainerStyle, styles.justifyContentEnd)}
66+
style={{transform: [{translateX: 0}, {translateY: 0}, {scaleY: -1}]}}
7067
/>
7168
);
7269
}

0 commit comments

Comments
 (0)