Repository navigation
Description
Overview
#939 removed the expo 46 web tooling (expo, @expo/webpack-config, babel-preset-expo, react-dom 17, react-native-web 0.14, app.config.js and the web script), because it couldn't run on React 19. Since then there has been no way to run the example on web, even though the README badge advertises android | ios | web, and the library ships a JS implementation (js/SegmentedControl.js) used on Android and web.
#940 rebuilt the native example (Android/iOS) on React Native 0.88.1 with react-native-test-app, which doesn't support web.
Proposal
Add a separate workspace package, example-web/, that runs the shared example/App.js on web with Expo SDK 58:
- Expo SDK 58 is built for exactly the versions the repo now uses:
react-native0.88.1,react/react-dom19.3.0,react-native-web~0.21.4. - It bundles with Metro, like the native example, and
babel-preset-expostrips Flow, so the library's untranspiledjs/sources work as they are. - It's a separate package rather than adding
expotoexample/, because puttingexpoinexample/would autolink Expo modules into thereact-native-test-appAndroid/iOS builds.
Scope:
example-web/package.jsonwithexpo,react-dom,react-native-web,@expo/metro-runtime, and the library viaworkspace:*- An entry that registers
../example/AppwithregisterRootComponent - A Metro config that watches the repo root and resolves the library from it (the same approach as
example/metro.config.js) - Root scripts:
pnpm web(dev server) and a static export (expo export --platform web) for CI - CI: a
webjob in theExample appsworkflow that runs the static export
Alternative considered: Vite with react-native-web. It's lighter, but the library ships Flow-typed sources, so it would need extra Flow-stripping setup. Expo matches what the example used before.
Acceptance criteria
-
pnpm webserves the example in a browser, and the segmented controls render and switch. -
expo export --platform websucceeds in CI. - The Android/iOS example builds are unaffected (no Expo modules autolinked into them).
- The Expo web example doesn't reintroduce any open Dependabot alerts.
Activity
chore(example): restore the web example with Expo SDK 58
chore(example): restore the web example with Expo SDK 58 (react-nativ…