Skip to content

Commit

Permalink
Merge pull request #11035 from rushatgabhane/rm-setNativeProps-invert…
Browse files Browse the repository at this point in the history
…edFlatList

InvertedFlatList - Migrate setNativeProps and pass style prop
  • Loading branch information
stitesExpensify authored Sep 26, 2022
2 parents f72fccf + 063da29 commit 900bb4a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/components/InvertedFlatList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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}]}}
/>
);
}
Expand Down

0 comments on commit 900bb4a

Please sign in to comment.