Skip to content

Expo and the community pick up react-native-web maintenance

updated

react-native-web is back under active development. In a GitHub discussion posted on October 7, collaborator Mathieu (@zoontek) announced that he, maintainer @necolas, Expo and the community are taking over maintenance of the library. The repository will also move to the React Foundation GitHub organization, alongside React and React Native.

A conservative direction

The stated goal is for react-native-web to follow React Native as closely as practical. Broader discussions about React Native APIs and native/web convergence are meant to happen in React Native itself, or in react-strict-dom where relevant, rather than in this repository.

Near-term maintenance work includes triaging open issues and pull requests and shipping bug fixes in regular releases.

Modernization on a 0.22-dev branch

All modernization work, including breaking changes, will land on a 0.22-dev branch. Most of it is not expected to change the public API. The plan includes:

  • Higher browser baselines (October 2021 versions): Chrome 95+ / Edge 95+, Firefox 93+, Safari 15.1+ / iOS Safari 15.1+. This allows removing vendor prefixes, user-agent sniffing, feature detection and old fallbacks such as the PointerEvent fallback.
  • React 19 only: the react and react-dom peer dependencies become ^19.0.0, which lets the project drop findDOMNode and forwardRef usage.
  • Flow to TypeScript: source, tests, the examples app and the benchmarks app will be converted.
  • New tooling: pnpm, tsdown, vitest and oxlint, among others.
  • ESM output: the package will be published with "type": "module".
  • Fewer dependencies, such as removing inline-style-prefixer and @babel/runtime.

Removed and added APIs

Modules that React Native core no longer ships will be removed: CheckBox, Picker, ProgressBar, YellowBox, InteractionManager and the legacy Touchable mixin (not TouchableOpacity and related components).

At the same time, the team wants to fill in React Native APIs that the web implementation lacks, with examples including PlatformColor, useAnimatedValue, usePressability, <Modal backdropColor="#000" />, <Text onTextLayout={() => {}} /> and <TextInput clearButtonMode="always" />.

babel-plugin-react-native-web is set to be deprecated. Modern bundlers achieve the same bundle-size benefit with a react-native → react-native-web alias plus tree shaking, and Expo CLI does not use the plugin.

Ideas for later

Feedback is requested on possible bundler plugins that would configure the alias and .web.js-first extension resolution, replace Platform.OS, Platform.select and Platform.isTesting at build time for dead-code elimination, resolve @2x / @3x / @4x assets (likely via srcset), and potentially extract CSS into a single file at build time, similar to StyleX.

Why it matters

For teams shipping React Native apps to the web, this provides a maintained path forward with a clearer relationship to React Native core. Projects still on React 18 or supporting older browsers should plan for the 0.22 requirements, and anyone relying on the removed modules or babel-plugin-react-native-web will need to migrate. In the thread, @necolas described the arrangement as "the ideal outcome for RNW". Contributors are asked to review PRs, test prereleases and report regressions.

Source: github.com