React Native for Web

It is always better to reuse the existing code. We always strive through the point that we need to have different developers for running our code in different platforms. For ex. A web developer is required to develop web applications and a Mobile developer for Mobile Apps Like Android and IOS

React Native solves our problem of having different developers for ios and android by providing the feature of development cross platform application that supported Android and ios.

Now there is still a need for Web Application Developers for developing web apps. react-native-web is the new library comes in to solve this problem. This library enables us to share the same code of React native to use for the web.

In this Article we can see how to use this library to achieve our goal of sharing our same React Native code to run on the web.

There are two scenarios for how we can develop React Native Apps.

  1. Expo
  2. React Native CLI

Note: React-native-web library is supported by expo and it runs under an expo environment.

Expo:

  • From Expo SDK Version 33, react-native-web is prebuilt in expo.
  • Current Version of expo pre built with react-native-web library.

How to create App in Expo:

  • To setup new project in expo, Use the following command in terminal
  • It will ask some details for configuration for the project.

 

Comments