From 1dad434d994cec4096a0be0a617395085c09db05 Mon Sep 17 00:00:00 2001 From: rory Date: Mon, 21 Sep 2026 16:29:01 -0700 Subject: [PATCH 1/3] Bump react-native-safe-area-context to 5.9.1 5.8.1 moves the Jest mock into the package build so it no longer imports react-native/Libraries subpaths that fail under the Strict API. 5.10.0 is the latest 5.x but is blocked by min-release-age. Drop the 5.6.2 removeChild patch, which landed upstream in 5.9.0. --- package-lock.json | 8 ++-- package.json | 2 +- .../react-native-safe-area-context/details.md | 18 -------- ...001+fix-removechild-crash-on-unmount.patch | 42 ------------------- 4 files changed, 5 insertions(+), 65 deletions(-) delete mode 100644 patches/react-native-safe-area-context/details.md delete mode 100644 patches/react-native-safe-area-context/react-native-safe-area-context+5.6.2+001+fix-removechild-crash-on-unmount.patch diff --git a/package-lock.json b/package-lock.json index 423d489352a8..b260ac7da0f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -137,7 +137,7 @@ "react-native-quick-crypto": "^1.1.6", "react-native-reanimated": "4.5.5", "react-native-render-html": "6.3.1", - "react-native-safe-area-context": "5.6.2", + "react-native-safe-area-context": "5.9.1", "react-native-screens": "4.25.0", "react-native-share": "11.0.2", "react-native-svg": "15.15.5", @@ -38189,9 +38189,9 @@ "license": "MIT" }, "node_modules/react-native-safe-area-context": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.6.2.tgz", - "integrity": "sha512-4XGqMNj5qjUTYywJqpdWZ9IG8jgkS3h06sfVjfw5yZQZfWnRFXczi0GnYyFyCc2EBps/qFmoCH8fez//WumdVg==", + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-5.9.1.tgz", + "integrity": "sha512-Zpx9Iwg6VhgNarWFpcIM61xK2lUbSfSXemQUmcvOVRpux49lJsUompY1S3E5jKUJbLq233qEpj28DgmXVsgZMQ==", "license": "MIT", "peerDependencies": { "react": "*", diff --git a/package.json b/package.json index ee2c70cea92a..bd96b8b5686b 100644 --- a/package.json +++ b/package.json @@ -213,7 +213,7 @@ "react-native-quick-crypto": "^1.1.6", "react-native-reanimated": "4.5.5", "react-native-render-html": "6.3.1", - "react-native-safe-area-context": "5.6.2", + "react-native-safe-area-context": "5.9.1", "react-native-screens": "4.25.0", "react-native-share": "11.0.2", "react-native-svg": "15.15.5", diff --git a/patches/react-native-safe-area-context/details.md b/patches/react-native-safe-area-context/details.md deleted file mode 100644 index dd20c6b60a05..000000000000 --- a/patches/react-native-safe-area-context/details.md +++ /dev/null @@ -1,18 +0,0 @@ -# `react-native-safe-area-context` patches - -### [react-native-safe-area-context+5.6.2+001+fix-removechild-crash-on-unmount.patch](react-native-safe-area-context+5.6.2+001+fix-removechild-crash-on-unmount.patch) - -- Reason: - - ``` - The web build of NativeSafeAreaProvider appends a hidden measurement element to document.body and - its effect cleanup removes it with document.body.removeChild(element), which throws NotFoundError - when the element is no longer a child of body. During navigation the provider subtree can be torn - down with the element already detached, and the throw escapes as an uncaught error. This patch - detaches the transition listener first and then uses element.remove(), which is a no-op when the - node has no parent. - ``` - -- Upstream PR/issue: https://github.com/appandflow/react-native-safe-area-context/pull/746 -- E/App issue: https://github.com/Expensify/App/issues/95343 -- PR introducing patch: https://github.com/Expensify/App/pull/97595 diff --git a/patches/react-native-safe-area-context/react-native-safe-area-context+5.6.2+001+fix-removechild-crash-on-unmount.patch b/patches/react-native-safe-area-context/react-native-safe-area-context+5.6.2+001+fix-removechild-crash-on-unmount.patch deleted file mode 100644 index 77ba8ec2586a..000000000000 --- a/patches/react-native-safe-area-context/react-native-safe-area-context+5.6.2+001+fix-removechild-crash-on-unmount.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/node_modules/react-native-safe-area-context/lib/commonjs/NativeSafeAreaProvider.web.js b/node_modules/react-native-safe-area-context/lib/commonjs/NativeSafeAreaProvider.web.js -index dcf0423..525dc18 100644 ---- a/node_modules/react-native-safe-area-context/lib/commonjs/NativeSafeAreaProvider.web.js -+++ b/node_modules/react-native-safe-area-context/lib/commonjs/NativeSafeAreaProvider.web.js -@@ -66,8 +66,8 @@ function NativeSafeAreaProvider({ - element.addEventListener(getSupportedTransitionEvent(), onEnd); - onEnd(); - return () => { -- document.body.removeChild(element); - element.removeEventListener(getSupportedTransitionEvent(), onEnd); -+ element.remove(); - }; - }, [onInsetsChange]); - return /*#__PURE__*/React.createElement(_reactNative.View, { -diff --git a/node_modules/react-native-safe-area-context/lib/module/NativeSafeAreaProvider.web.js b/node_modules/react-native-safe-area-context/lib/module/NativeSafeAreaProvider.web.js -index 7f75c72..6a22f8c 100644 ---- a/node_modules/react-native-safe-area-context/lib/module/NativeSafeAreaProvider.web.js -+++ b/node_modules/react-native-safe-area-context/lib/module/NativeSafeAreaProvider.web.js -@@ -59,8 +59,8 @@ export function NativeSafeAreaProvider({ - element.addEventListener(getSupportedTransitionEvent(), onEnd); - onEnd(); - return () => { -- document.body.removeChild(element); - element.removeEventListener(getSupportedTransitionEvent(), onEnd); -+ element.remove(); - }; - }, [onInsetsChange]); - return /*#__PURE__*/React.createElement(View, { -diff --git a/node_modules/react-native-safe-area-context/src/NativeSafeAreaProvider.web.tsx b/node_modules/react-native-safe-area-context/src/NativeSafeAreaProvider.web.tsx -index d3eceed..7986228 100644 ---- a/node_modules/react-native-safe-area-context/src/NativeSafeAreaProvider.web.tsx -+++ b/node_modules/react-native-safe-area-context/src/NativeSafeAreaProvider.web.tsx -@@ -55,8 +55,8 @@ export function NativeSafeAreaProvider({ - element.addEventListener(getSupportedTransitionEvent(), onEnd); - onEnd(); - return () => { -- document.body.removeChild(element); - element.removeEventListener(getSupportedTransitionEvent(), onEnd); -+ element.remove(); - }; - }, [onInsetsChange]); - From c72aad2ef3863390ceec11339b12fb1aa98e449d Mon Sep 17 00:00:00 2001 From: rory Date: Mon, 21 Sep 2026 16:36:04 -0700 Subject: [PATCH 2/3] Update Podfile.lock for react-native-safe-area-context 5.9.1 The podspec is unchanged aside from the version it reads from package.json, so only the version pins move. --- ios/Podfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2cae9404a7e5..d6329c1a3246 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2251,7 +2251,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - react-native-safe-area-context (5.6.2): + - react-native-safe-area-context (5.9.1): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2263,8 +2263,8 @@ PODS: - React-graphics - React-ImageManager - React-jsi - - react-native-safe-area-context/common (= 5.6.2) - - react-native-safe-area-context/fabric (= 5.6.2) + - react-native-safe-area-context/common (= 5.9.1) + - react-native-safe-area-context/fabric (= 5.9.1) - React-NativeModulesApple - React-RCTFabric - React-renderercss @@ -2275,7 +2275,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - react-native-safe-area-context/common (5.6.2): + - react-native-safe-area-context/common (5.9.1): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2297,7 +2297,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - react-native-safe-area-context/fabric (5.6.2): + - react-native-safe-area-context/fabric (5.9.1): - hermes-engine - RCTRequired - RCTTypeSafety From 1b7bf377bf9be8309e677e2d7be8401ef5fbf34a Mon Sep 17 00:00:00 2001 From: rory Date: Mon, 21 Sep 2026 21:25:45 -0700 Subject: [PATCH 3/3] Refresh the safe-area-context pod checksum for 5.9.1 CocoaPods checksums the generated local podspec JSON, which embeds the version, so the SPEC CHECKSUMS entry has to move with the version pins. --- ios/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d6329c1a3246..b07dd0afe2c5 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -4052,7 +4052,7 @@ SPEC CHECKSUMS: react-native-pdf: f5336904e04a95103a90fcdf349bbd8e278350b9 react-native-plaid-link-sdk: a2df4f145f61869507d730062764abca085b6a00 react-native-quick-base64: e254a406ac7d7f20857c9fbcbfb57fbf91ae21be - react-native-safe-area-context: 4b3960e27c8a3ca0c1523348f97513e27f8509b7 + react-native-safe-area-context: 6acf61f42ee0862bbe00ed7e6c11cd0b81b7f6e3 react-native-skia: b3c25cbcfdc2d4f68b73390ff1b50ef2a9bc5968 react-native-view-shot: 6da2aaa0404b8d617ab1689550acdb251d759af9 react-native-wallet: 69c8fde0b0e16899b95b2689f7cb737f4ec247f9