From 34cf901b957b002ed9373291bdc879fb67fe96fc Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 22 Aug 2024 22:51:15 +0200 Subject: [PATCH 1/2] add tab-view patch to fix zero layout size flicker --- ...-view+3.5.2+001+fixLayoutZeroFlicker.patch | 29 +++++++++++++++++++ ...t-native-tab-view+3.5.2+001+initial.patch} | 0 2 files changed, 29 insertions(+) create mode 100644 patches/react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch rename patches/{react-native-tab-view+3.5.2.patch => react-native-tab-view+3.5.2+001+initial.patch} (100%) diff --git a/patches/react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch b/patches/react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch new file mode 100644 index 000000000000..1f42ef2885b0 --- /dev/null +++ b/patches/react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch @@ -0,0 +1,29 @@ +diff --git a/node_modules/react-native-tab-view/lib/module/TabView.js b/node_modules/react-native-tab-view/lib/module/TabView.js +index ba28170..4c607a2 100644 +--- a/node_modules/react-native-tab-view/lib/module/TabView.js ++++ b/node_modules/react-native-tab-view/lib/module/TabView.js +@@ -40,6 +40,9 @@ export function TabView(_ref) { + height, + width + } = e.nativeEvent.layout; ++ if(!!width || !!height) { ++ return; ++ } + setLayout(prevLayout => { + if (prevLayout.width === width && prevLayout.height === height) { + return prevLayout; +diff --git a/node_modules/react-native-tab-view/src/TabView.tsx b/node_modules/react-native-tab-view/src/TabView.tsx +index bb1f531..d70f9ba 100644 +--- a/node_modules/react-native-tab-view/src/TabView.tsx ++++ b/node_modules/react-native-tab-view/src/TabView.tsx +@@ -70,6 +70,10 @@ export function TabView({ + const handleLayout = (e: LayoutChangeEvent) => { + const { height, width } = e.nativeEvent.layout; + ++ if(!!width || !!height) { ++ return; ++ } ++ + setLayout((prevLayout) => { + if (prevLayout.width === width && prevLayout.height === height) { + return prevLayout; diff --git a/patches/react-native-tab-view+3.5.2.patch b/patches/react-native-tab-view+3.5.2+001+initial.patch similarity index 100% rename from patches/react-native-tab-view+3.5.2.patch rename to patches/react-native-tab-view+3.5.2+001+initial.patch From 9ddbfaede81a46e5440b028b9c7c3b5ddb896b0c Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:18:43 +0200 Subject: [PATCH 2/2] fix patch name --- ...ve-tab-view+3.5.2+002+fixZeroWidthHeightPositionFlicker.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename patches/{react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch => react-native-tab-view+3.5.2+002+fixZeroWidthHeightPositionFlicker.patch} (100%) diff --git a/patches/react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch b/patches/react-native-tab-view+3.5.2+002+fixZeroWidthHeightPositionFlicker.patch similarity index 100% rename from patches/react-native-tab-view+3.5.2+001+fixLayoutZeroFlicker.patch rename to patches/react-native-tab-view+3.5.2+002+fixZeroWidthHeightPositionFlicker.patch