A Babel plugin that aliases `react-native` to `react-native-web` during build, enabling reuse of React Native components for web applications. Current stable version 0.0.14. It selectively rewrites imports to pull only required modules, reducing bundle size. Compared to alternatives like `react-native-web` alone, this plugin automates the alias and tree-shaking, integrating seamlessly into Babel configuration. Released under MIT license, actively used in Expo projects, with regular updates following `react-native-web` releases.
npm install babel-plugin-expo-webVerified import paths — ran on the pinned version, not inferred.
Set up the Babel plugin to alias react-native to react-native-web, enabling a simple React Native component to render on web.
Always use the Babel plugin to handle aliasing; never import from react-native-web/dist directly.
Use 'react-native-web' as the plugin string in your Babel configuration.
Run 'yarn add react-native-web' to install the required package.