A PR preview is a JS bundle built from your PR and published to Expo Updates. Anyone with a beta can load it from the dev menu, so reviewers and QA can try your PR on a real device without a new beta and without taking over the canary channel.
A preview carries JS changes only. If your PR changes native code, the workflow doesn't publish and asks for new betas instead.
To create a preview:
- Add the
previewlabel to your PR. - Wait for the PR Preview workflow to finish. It writes the result into the PR preview section of the PR description.
- On a beta, open the dev menu, expand Preview PR, enter the PR number, and tap Load PR.
Every push to the PR publishes a new bundle to the same channel, review-app-<PR number>. When you close or merge the PR, the workflow deletes the channel.
PRs from forks don't get previews, because fork PRs can't read the repo's secrets.
This works like Force review apps. Name your branch with the review-app- prefix, for example review-app-city-guide-map, and open a PR from it. The workflow publishes a preview on every push, with no label needed.
The channel name comes from the PR number, not the branch name. PR 14300 from review-app-city-guide-map publishes to review-app-14300.
Removing the label from a review-app-* PR doesn't delete its preview. Closing or merging the PR does.
The workflow writes its result between the <!-- pr-preview:start --> and <!-- pr-preview:end --> markers that the PR template adds. Don't edit inside the markers, because the next run overwrites them. If you deleted the markers, the workflow adds the section to the end of the description.
The result depends on how your PR's native code compares to main:
| Status | Publishes | The section shows | What to do |
|---|---|---|---|
level |
Yes | The PR number and the channel | Nothing |
behind |
Yes | The PR number and the channel, plus a warning that main's native code changed since you branched |
Rebase onto main to clear the warning |
ahead |
No | A caution that the PR changes native code, with a table of fingerprints | Deploy new betas instead. See Beta Deployment. |
Two other messages can appear:
- Publish failed. The section links to the workflow run. Open it to see which step failed.
- Runtime mismatch. This warning can sit on top of a
levelorbehindresult. Your PR'sexpo.runtimeVersioninapp.jsondiffers frommain's, usually becausemainbumped the app version after you branched. Builds frommainwon't load the bundle. Rebase ontomain.
These builds can load a preview:
- iOS: a TestFlight beta or a Firebase beta.
- Android: a Firebase beta.
The Play Store beta can't load a preview. It's a release build, the same type as production, so the dev menu shows Preview PRs unavailable. Local Debug builds can't either, because they have expo-updates turned off.
See Welcome to Eigen beta to join TestFlight, or ask eigen beta? in #practice-mobile for the Firebase links.
To load a preview:
- Open the dev menu. See Dev Menu.
- Expand Preview PR.
- Enter the PR number and tap Load PR.
- Check the PR title, commit, and channel in the alert, then tap Switch.
The app downloads the bundle and reloads. On Android, if you see "Update downloaded, but the app can't reload itself", force-quit and reopen the app.
To load a newer push of the same PR, enter the PR number again and tap Load PR.
When the app runs a preview, the Preview PR section shows an Active Preview message with the channel and PR number. The app also draws an orange line in these places:
- around the Dynamic Island, on iPhones that have one
- along the top of the bottom tab bar
- along the bottom of the artwork screen header
- along the top of the sign-in modal
Staging uses the same lines in purple.
If Load PR fails, the dev menu shows one of these messages:
PR #<number> not found: check the number.PR #<number> is not open: closed and merged PRs have no preview.PR #<number> doesn't have the "preview" label and isn't on a review-app-* branch: add the label.No update has been published to review-app-<number> yet.: wait for the workflow, or check the PR preview section for anaheadstatus or a failed publish.
To go back to the beta's own bundle, delete the app and install the beta again from TestFlight or Firebase.
You don't need to delete a preview by hand. The workflow deletes the Expo channel and branch named review-app-<PR number> and resets the PR preview section when either of these happens:
- You close or merge a PR that has the
previewlabel or areview-app-*branch. - You remove the
previewlabel from a PR whose branch doesn't start withreview-app-.
The workflow is .github/workflows/pr-preview.yml, and its scripts live in scripts/pr-preview/.
The workflow listens to pull_request events: opened, labeled, unlabeled, synchronize, and closed.
- It publishes when you add the
previewlabel, or when you open or push to a PR that has the label or areview-app-*branch. - It cleans up on the events listed in Deleting a preview.
A new publish or cleanup run for a PR cancels the one still going for that PR.
A JS bundle that expects native code the build doesn't have crashes on launch. To avoid that, the workflow compares three @expo/fingerprint hashes:
- PR: the fingerprint at the PR head. The
pr-fingerprintjob computes it withcheckNativeStatus.ts fingerprint. - Merge base: the fingerprint at
git merge-base HEAD origin/main. On every push tomain,expo-fingerprint-check.ymlsavesmain's fingerprint to the GitHub Actions cache undernative-fingerprint-<sha>. Thebase-fingerprintjob restores it from there. On a cache miss, the job checks out the merge base, computes the fingerprint, and saves it for the next push. - Main:
s3://mobile-cached-builds/eigen-expo-fingerprint/latest.txt.expo-fingerprint-check.ymlrewrites this file whenevermain's native code changes.
The native-status job runs checkNativeStatus.ts status, which picks the status in this order:
- If the PR fingerprint equals main's, the status is
level. - If the PR fingerprint differs from the merge base's, the PR changed native code, and the status is
ahead. - Otherwise only
mainchanged native code, and the status isbehind.
Fingerprints ignore expo.runtimeVersion, so the same job also reads it from the PR's app.json and from main's. A mismatch adds the runtime warning to the PR description.
The publish job runs unless the status is ahead. It calls the same Fastlane lane as other Expo Updates deploys:
bundle exec fastlane deploy_to_expo_updates deployment_name:review-app-<PR number> description:"PR preview #<PR number> at <sha>" platform:all preview:trueThe lane runs eas update for both platforms and uploads source maps to Sentry. preview:true skips the git tags the lane pushes for canary, staging, and production deploys.
The workflow calls the lane directly, not through deploy-to-expo-updates-ci. So the fingerprint pre-flight from Deploying to Expo Updates doesn't run here. The native check above takes its place.
The update-pr-description job runs updatePrDescription.ts report once native-status succeeds, whether publish passed, failed, or was skipped. It doesn't run if a newer push cancelled the run, so a stale result never overwrites a newer one. prDescription.ts builds the text.
The cleanup-preview job runs eas channel:delete and eas branch:delete for review-app-<PR number>. If the channel or branch is already gone, the job moves on. Then updatePrDescription.ts clear resets the PR preview section to the template's placeholder.
PreviewPROptions.tsxis the Preview PR section of the dev menu. It points expo-updates at the PR's channel withUpdates.setUpdateRequestHeadersOverride, then fetches the update and reloads. If no update is available or the download fails, it switches back to the previous channel.previewPR.tsreads the PR from the public GitHub API and checks that it's open and has thepreviewlabel or areview-app-*branch, the same rule the workflow uses.useEnvironmentColor.tsreturnsorange100while a preview bundle runs, anddevpurpleon staging.DynamicIslandEnvironmentIndicator.tsxand the screens listed in Loading a preview on a device use it.