“React Native for Web” makes it possible to run React Native components and APIs on the web using React DOM — allowing you to target the Android

Run your React Native app on the web with React Native for Web

submited by
Style Pass
2021-06-13 17:00:06

“React Native for Web” makes it possible to run React Native components and APIs on the web using React DOM — allowing you to target the Android, iOS, and web platforms using a single codebase.

The React Native for Web documentation has a few examples of how to get started from scratch. For example, you can use expo or create-react-native-app to create a new React Native project compatible with React Native for Web. Or you can use Create React App to generate a simple, web-only React app with built-in support of React Native for Web.

In this post, I’d like to take a different approach from the one used in the React Native for Web documentation: I’ll explain how to add React Native for Web to an existing React Native app using Create React App.

The standard way to setup a React app from scratch using Create React App is by using the create-react-app CLI to generate the entire project. However, in our case, we’re adding a React app on top of an existing project, so the setup process will be a bit different.

Leave a Comment