Installation

An overview of how to install and use React Native for Web.

React Native for Web can be used for multi-platform and web-only applications. It can be incrementally adopted by existing React Web apps and integrated with existing React Native apps. Preact is also supported.

npm install react-dom react-native-web

The Babel plugin is recommended for build-time optimizations.

npm install --save-dev babel-plugin-react-native-web

Quickstart #

Expo #

Expo is a framework and a platform for universal React applications. Expo for Web uses React Native for Web, provides dozens of additional cross-platform APIs, includes web build optimizations, and is compatibile with the broader React Native ecosystem.

npx expo-cli init my-app
cd my-app
npm install react-dom react-native-web
npx expo-cli start

Create React App #

Create React App is a basic way to setup a simple, web-only React app with built-in support for aliasing react-native-web to react-native. However, it’s generally recommended that you use Expo.

npx create-react-app my-app
cd my-app
npm install react-native-web
npm start

Integrations #

Visit the React Native Directory to find React Native packages with known web support. Popular web frameworks maintain example integrations.

Updated
Edit
React Native for WebCopyright © Nicolas Gallagher and Facebook Inc.