RUN REACT NATIVE ON WEB BROWSER | REACT NATIVE

Share the post

HOW TO RUN REACT NATIVE ON WEB BROWSER ?

Hello All, In last topic we had discussed about How to install react native & How to create a new project in react native using CLI. Now in this topic we will discuss about How to run react native on web browser ? What are the steps to follow to run react native on browser ? So, follow the below steps to run react native application on browser.

Steps to follow to run react native on browser

1.Open the command prompt in administrative mode & write below command to install expo-cli

npm i -g expo-cli

What is Expo ?

Expo is the Platform & Framework for React applications. It’s the set of services which help us to build react native applications.

2. Add web dependency using following command

npm add react-native-web@~0.11 react-dom

3. Now, Run the following command to run application on browser

expo start:web

4. Above command will redirect to browser & open the localhost page as shown in below image

http://localhost:19002/
Output
Output

5. After that click on Run in web browser as shown in below image

Click on Run in web browser
Click on Run in web browser

6. It will open new tab & our application will successfully run on browser

http://localhost:19006/

So, follow the above steps to run application react native on browser. In next topic we will discuss about How to create & navigate pages in react native application. Stay tuned for more react native tutorials.

Leave a Comment