Skip to content

Commit 6940792

Browse files
authored
docs: note Expo precompiled modules drop the react-native-screens patch on EAS (#715)
* docs: note Expo precompiled modules drop the react-native-screens patch on EAS * docs: add changelog entry for Expo precompiled modules note
1 parent b610fc5 commit 6940792

4 files changed

Lines changed: 45 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
- Bump `react-native-monorepo-config` to fix build on windows. ([#672](https://github.com/lodev09/react-native-true-sheet/pull/672) by [@harveylx](https://github.com/harveylx))
2828
- Upgrade examples to Expo SDK 56 / React Native 0.85.3, TypeScript 6, and `react-native-builder-bob` 0.41. ([#694](https://github.com/lodev09/react-native-true-sheet/pull/694) by [@lodev09](https://github.com/lodev09))
29+
- **Docs**: Documented that Expo SDK 56+ ships `react-native-screens` precompiled on EAS, silently dropping the navigation patch; added a Troubleshooting fix (`EXPO_USE_PRECOMPILED_MODULES=0`). ([#715](https://github.com/lodev09/react-native-true-sheet/pull/715) by [@lodev09](https://github.com/lodev09))
2930

3031
## 3.10.1
3132

docs/docs/guides/navigation.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ navigation.navigate('SomeScreen')
276276
```
277277

278278
:::note
279-
Requires a [patch to react-native-screens](https://github.com/lodev09/react-native-true-sheet/blob/main/.yarn/patches/react-native-screens-npm-4.18.0-fa7de65975.patch). See [PR #3415](https://github.com/software-mansion/react-native-screens/pull/3415).
279+
Requires a [patch to react-native-screens](https://github.com/lodev09/react-native-true-sheet/blob/main/.yarn/patches/react-native-screens-npm-4.25.2.patch). See [PR #3415](https://github.com/software-mansion/react-native-screens/pull/3415).
280+
281+
On **Expo SDK 56+**, this patch is silently dropped on EAS builds because `react-native-screens` ships precompiled. See [Patched react-native-screens Not Applied on EAS](../troubleshooting#patched-react-native-screens-not-applied-on-eas-precompiled-modules) to force it to build from source.
280282
:::
281283

282284
### Web Limitation

docs/docs/migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ See the [Configuration reference](reference/configuration#bluroptions) for more
383383
Version 3 works seamlessly with React Navigation! You can navigate to other screens from within a sheet and the sheet will remain visible in the background when presenting modals on top.
384384

385385
:::note
386-
This requires changes to `react-native-screens`. There is a [pending PR](https://github.com/software-mansion/react-native-screens/pull/3415) that adds support for this. In the meantime, you can apply the patch from the [example app](https://github.com/lodev09/react-native-true-sheet/blob/main/.yarn/patches/react-native-screens-npm-4.18.0-fa7de65975.patch).
386+
This requires changes to `react-native-screens`. There is a [pending PR](https://github.com/software-mansion/react-native-screens/pull/3415) that adds support for this. In the meantime, you can apply the patch from the [example app](https://github.com/lodev09/react-native-true-sheet/blob/main/.yarn/patches/react-native-screens-npm-4.25.2.patch).
387387
:::
388388

389389
```tsx

docs/docs/troubleshooting.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,43 @@ When using [EAS Build](https://docs.expo.dev/build/introduction/), configure you
140140
}
141141
}
142142
```
143+
144+
### Patched `react-native-screens` Not Applied on EAS (Precompiled Modules)
145+
146+
If you apply the [`react-native-screens` patch](guides/navigation) so the sheet stays visible when presenting screens on top, you may find that on **Expo SDK 56+ EAS builds** the sheet dismisses — or a full-screen modal fails to present over the sheet — even though it works in a local build.
147+
148+
This is because Expo SDK 56 ships `react-native-screens` (and other common libraries like `react-native-reanimated`, `react-native-svg`) as **precompiled XCFrameworks** on EAS. The prebuilt framework is built from the library's own source, so any patch you apply to `react-native-screens` (via `patch-package`, `pnpm patch`, or Yarn `patches`) is **never compiled in** — it's silently ignored on EAS, while local builds still work because they fall back to compiling from source.
149+
150+
**Fix:**
151+
152+
Disable precompiled modules so `react-native-screens` builds from your patched source. Add the env var to each build profile in `eas.json`:
153+
154+
```json
155+
{
156+
"build": {
157+
"development": { "env": { "EXPO_USE_PRECOMPILED_MODULES": "0" } },
158+
"preview": { "env": { "EXPO_USE_PRECOMPILED_MODULES": "0" } },
159+
"production": { "env": { "EXPO_USE_PRECOMPILED_MODULES": "0" } }
160+
}
161+
}
162+
```
163+
164+
This only disables **module** precompilation — React Native core stays prebuilt, so build times are largely unaffected.
165+
166+
:::info
167+
To keep precompiled modules for everything else and only build `react-native-screens` from source, opt it out per-package in `package.json` instead:
168+
169+
```json
170+
{
171+
"expo": {
172+
"autolinking": {
173+
"ios": { "buildFromSource": ["react-native-screens"] }
174+
}
175+
}
176+
}
177+
```
178+
:::
179+
180+
:::warning
181+
Avoid `ios.buildReactNativeFromSource: true` for this — it also rebuilds React Native core from source, which is much slower.
182+
:::

0 commit comments

Comments
 (0)