Skip to content

Commit 49672b4

Browse files
fix: replace default export with named export in SafeAreaView.web patch
Aligns with the updated approach in the upstream PR (software-mansion/react-native-screens#3956): the native variant has only ever had a named export, and the package's public surface only re-exports as named, so dropping the default on web brings everything in line. Co-authored-by: Cursor <[email protected]>
1 parent d8f9c27 commit 49672b4

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

patches/react-native-screens/details.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### [react-native-screens+4.25.0-beta.1.patch](react-native-screens+4.25.0-beta.1.patch)
44

5-
- Reason: `SafeAreaView.web.tsx` only has a `default` export, but `safe-area/index.ts` re-exports it as a named export (`export { SafeAreaView } from './SafeAreaView'`). Webpack resolves the `.web` variant for web builds, causing a `ModuleDependencyWarning` that fails the Storybook smoke test. The fix adds a named export alongside the existing default export.
5+
- Reason: `SafeAreaView.web.tsx` only had a `default` export, but `safe-area/index.ts` re-exports it as a named export (`export { SafeAreaView } from './SafeAreaView'`). Webpack resolves the `.web` variant for web builds, causing a `ModuleDependencyWarning` that fails the Storybook smoke test. The fix replaces the default export with a named export to match the native variant (`SafeAreaView.tsx`), which only has a named export.
66
- Upstream PR/issue: https://github.com/software-mansion/react-native-screens/pull/3956 — once merged and released, bump the version and remove this patch.
77
- E/App issue: 🛑
88
- PR Introducing Patch: https://github.com/Expensify/App/pull/89199
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
diff --git a/node_modules/react-native-screens/lib/module/components/safe-area/SafeAreaView.web.js b/node_modules/react-native-screens/lib/module/components/safe-area/SafeAreaView.web.js
2-
index 398afe2..60f14e2 100644
2+
index 398afe2..2c2bb35 100644
33
--- a/node_modules/react-native-screens/lib/module/components/safe-area/SafeAreaView.web.js
44
+++ b/node_modules/react-native-screens/lib/module/components/safe-area/SafeAreaView.web.js
5-
@@ -1,4 +1,5 @@
5+
@@ -1,4 +1,4 @@
66
import { View } from 'react-native';
77
const SafeAreaView = View;
8+
-export default SafeAreaView;
89
+export { SafeAreaView };
9-
export default SafeAreaView;
1010
//# sourceMappingURL=SafeAreaView.web.js.map
1111
diff --git a/node_modules/react-native-screens/src/components/safe-area/SafeAreaView.web.tsx b/node_modules/react-native-screens/src/components/safe-area/SafeAreaView.web.tsx
12-
index aff03a5..3398bef 100644
12+
index aff03a5..d822cb8 100644
1313
--- a/node_modules/react-native-screens/src/components/safe-area/SafeAreaView.web.tsx
1414
+++ b/node_modules/react-native-screens/src/components/safe-area/SafeAreaView.web.tsx
15-
@@ -1,5 +1,8 @@
15+
@@ -1,5 +1,7 @@
1616
+// Implementation adapted from `react-native-safe-area-context`:
1717
+// https://github.com/AppAndFlow/react-native-safe-area-context/blob/v5.6.1/src/SafeAreaView.tsx
1818
import { View } from 'react-native';
1919

2020
const SafeAreaView = View;
2121

22+
-export default SafeAreaView;
2223
+export { SafeAreaView };
23-
export default SafeAreaView;

0 commit comments

Comments
 (0)