[FIX] Poor performance in messages list on Android 11 (#3260)
This commit is contained in:
parent
6385daebb5
commit
3e53a76238
|
@ -0,0 +1,55 @@
|
|||
diff --git a/node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js b/node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js
|
||||
index c344ac4..479c8c0 100644
|
||||
--- a/node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js
|
||||
+++ b/node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js
|
||||
@@ -1244,9 +1244,17 @@ class ScrollView extends React.Component<Props, State> {
|
||||
// Note: we should split props.style on the inner and outer props
|
||||
// however, the ScrollView still needs the baseStyle to be scrollable
|
||||
const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
|
||||
+
|
||||
+ // Workaround for RefreshControl inverted: https://github.com/facebook/react-native/issues/30034
|
||||
+ let inverted;
|
||||
+ if (inner.scaleY) {
|
||||
+ inverted = { scaleY: -1 };
|
||||
+ delete inner.scaleY;
|
||||
+ }
|
||||
+
|
||||
return React.cloneElement(
|
||||
refreshControl,
|
||||
- {style: [baseStyle, outer]},
|
||||
+ {style: [baseStyle, outer, inverted]},
|
||||
<ScrollViewClass
|
||||
{...props}
|
||||
style={[baseStyle, inner]}
|
||||
diff --git a/node_modules/react-native/Libraries/Lists/VirtualizedList.js b/node_modules/react-native/Libraries/Lists/VirtualizedList.js
|
||||
index 9ec105f..6bb6989 100644
|
||||
--- a/node_modules/react-native/Libraries/Lists/VirtualizedList.js
|
||||
+++ b/node_modules/react-native/Libraries/Lists/VirtualizedList.js
|
||||
@@ -11,6 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
const Batchinator = require('../Interaction/Batchinator');
|
||||
+const Platform = require('../Utilities/Platform');
|
||||
const FillRateHelper = require('./FillRateHelper');
|
||||
const PropTypes = require('prop-types');
|
||||
const React = require('react');
|
||||
@@ -2185,9 +2186,16 @@ function describeNestedLists(childList: {
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
- verticallyInverted: {
|
||||
- transform: [{scaleY: -1}],
|
||||
- },
|
||||
+ // Workaround found on https://github.com/facebook/react-native/issues/30034#issuecomment-806396274
|
||||
+ // Note: Check ScrollView for a workaround on RefreshControl
|
||||
+ verticallyInverted:
|
||||
+ Platform.OS === 'android'
|
||||
+ ? {
|
||||
+ scaleY: -1,
|
||||
+ }
|
||||
+ : {
|
||||
+ transform: [{scaleY: -1}]
|
||||
+ },
|
||||
horizontallyInverted: {
|
||||
transform: [{scaleX: -1}],
|
||||
},
|
Loading…
Reference in New Issue