Skip to content

Commit

Permalink
[pay-1214] add patch to fix inverted list ANR bug (#3457)
Browse files Browse the repository at this point in the history
  • Loading branch information
schottra authored May 31, 2023
1 parent 018ff3b commit 7441321
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/mobile/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/* eslint-disable import/first */
/* eslint-disable import/order */
import 'react-native-gesture-handler'
// react-native has an issue with inverted lists on Android, and it got worse
// with Android 13. To avoid it we patch a react-native style, but that style
// got deprecated in React Native 0.70. For now the deprecation is limited to a
// JS runtime check, which we disable here.
import ViewReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes'
ViewReactNativeStyleAttributes.scaleY = true
import { AppRegistry, LogBox } from 'react-native'
import TrackPlayer from 'react-native-track-player'

Expand Down
6 changes: 5 additions & 1 deletion packages/mobile/patches/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ Patch to support full screen swipe gestures in native stack. and navigation draw

## react-native-gesture-handler+1.10.3.patch

Patch to support full screen swipe gestures in native stack. and navigation drawers and their interplay with material top tabs.See https://github.com/callstack/react-native-pager-view/pull/500
Patch to support full screen swipe gestures in native stack. and navigation drawers and their interplay with material top tabs.See https://github.com/callstack/react-native-pager-view/pull/500

## react-native+0.71.8.patch

Patch to prevent a freezing issue on some Android 13 devices when using an inverted FlatList with a lot of text or any animations. See https://github.com/facebook/react-native/issues/35350 and https://github.com/facebook/react-native/issues/30034
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ index 7279c2a..c3519b2 100644
+ this._listeners.forEach(listener => listener?.(...args));
};
}
diff --git a/node_modules/react-native/Libraries/Lists/VirtualizedList.js b/node_modules/react-native/Libraries/Lists/VirtualizedList.js
index e948a85..0814a98 100644
--- a/node_modules/react-native/Libraries/Lists/VirtualizedList.js
+++ b/node_modules/react-native/Libraries/Lists/VirtualizedList.js
@@ -25,6 +25,7 @@ import RefreshControl from '../Components/RefreshControl/RefreshControl';
import ScrollView from '../Components/ScrollView/ScrollView';
import View from '../Components/View/View';
import Batchinator from '../Interaction/Batchinator';
+import Platform from '../Utilities/Platform';
import {findNodeHandle} from '../ReactNative/RendererProxy';
import flattenStyle from '../StyleSheet/flattenStyle';
import StyleSheet from '../StyleSheet/StyleSheet';
@@ -1843,9 +1844,14 @@ export default class VirtualizedList extends StateSafePureComponent<
}

const styles = StyleSheet.create({
- verticallyInverted: {
- transform: [{scaleY: -1}],
- },
+ verticallyInverted:
+ Platform.OS === 'android'
+ ? {
+ scaleY: -1,
+ }
+ : {
+ transform: [{scaleY: -1}]
+ },
horizontallyInverted: {
transform: [{scaleX: -1}],
},
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
Expand Down

0 comments on commit 7441321

Please sign in to comment.