From 9af820729bc5f3b1f89ce575e41cca23277bad45 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 20 Aug 2025 10:07:43 +0200 Subject: [PATCH 1/2] Fix memory leak with Animated API --- patches/react-native-web/details.md | 11 +++++++++++ ...react-native-web+0.20.0+011+fix-memory-leak.patch | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 patches/react-native-web/react-native-web+0.20.0+011+fix-memory-leak.patch diff --git a/patches/react-native-web/details.md b/patches/react-native-web/details.md index 8e9a518e494e..da6995b47d35 100644 --- a/patches/react-native-web/details.md +++ b/patches/react-native-web/details.md @@ -119,3 +119,14 @@ - Upstream PR/issue: The patch isn't something we can apply to upstream because we are specifically allowing custom props used by Fullstory to be forwarded to their respective DOM elements. - E/App issue: As explained above the current solution can't be applied to upstream because it's tailored to Fullstory needs. - PR introducing patch: https://github.com/Expensify/App/pull/67552 + +### [react-native-web+0.20.0+011+fix-memory-leak.patch](react-native-web+0.20.0+011+fix-memory-leak.patch) +- Reason: + + ``` + Fixes memory leak on web caused by Animated API used in @react-navigation package + ``` + +- Upstream PR/issue: https://github.com/necolas/react-native-web/pull/2800 +- E/App issue: https://github.com/Expensify/App/issues/65820 +- PR introducing patch: https://github.com/Expensify/App/pull/x \ No newline at end of file diff --git a/patches/react-native-web/react-native-web+0.20.0+011+fix-memory-leak.patch b/patches/react-native-web/react-native-web+0.20.0+011+fix-memory-leak.patch new file mode 100644 index 000000000000..bd749e123c7d --- /dev/null +++ b/patches/react-native-web/react-native-web+0.20.0+011+fix-memory-leak.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedProps.js b/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedProps.js +index 9ba3336..2d67005 100644 +--- a/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedProps.js ++++ b/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedProps.js +@@ -68,6 +68,7 @@ class AnimatedProps extends AnimatedNode { + if (this.__isNative && this._animatedView) { + this.__disconnectAnimatedView(); + } ++ this._animatedView = null + for (var key in this._props) { + var value = this._props[key]; + if (value instanceof AnimatedNode) { From e81d3522b3963291a854b566a6846b6fb61315a8 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Wed, 20 Aug 2025 10:08:57 +0200 Subject: [PATCH 2/2] Add PR number to details.md file --- patches/react-native-web/details.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/react-native-web/details.md b/patches/react-native-web/details.md index da6995b47d35..6629cf89a047 100644 --- a/patches/react-native-web/details.md +++ b/patches/react-native-web/details.md @@ -129,4 +129,4 @@ - Upstream PR/issue: https://github.com/necolas/react-native-web/pull/2800 - E/App issue: https://github.com/Expensify/App/issues/65820 -- PR introducing patch: https://github.com/Expensify/App/pull/x \ No newline at end of file +- PR introducing patch: https://github.com/Expensify/App/pull/68834 \ No newline at end of file