2
Answers

localhost when running expo go on browser

Photo of Guest User

Guest User

2y
784
1

Hi Team

Is it possible to see your react-native app on the browser ,  am using expo go then scan it then it launches. Is there a way i can also see an app via browser using localhost?

Answers (2)

0
Photo of Rajkiran Swain
28 40.7k 3.4m 2y

Yes, it is possible to view your React Native app on a browser using localhost while using Expo Go. Here are the steps to follow:

  1. Start your React Native app by running expo start in your project directory.

  2. Once the Expo DevTools are open in your browser, click on the "Run in web browser" button located on the left-hand side of the page.

  3. This should open a new tab in your browser displaying your app running on a local server, with the URL typically being http://localhost:19006/.

  4. To view your app on a mobile device, open the Expo Go app and scan the QR code that appears in the browser tab. This will launch your app on the device.

  5. You can now view your app both on your mobile device through the Expo Go app and on your browser through the localhost server.

Note that not all React Native features may be supported in the web version of your app, so it may not function exactly the same as it does on your mobile device.

I hope this helps!

Accepted
2
Photo of Tuhin Paul
39 34.6k 314.4k 2y

You can use the Expo CLI to create a local server and run the app on a browser.

1. Install the Expo CLI by running the following command in your terminal:  

   npm install -g expo-cli

2. Create a new React Native project by running the following command in your terminal:  

expo init myapp

3. Navigate to your project directory and start the local server by running the following command:   


   cd myapp
   expo start --web

4. This will start the Expo development server and open a browser window with your app running on `http://localhost:19006/`. 

   If the browser doesn't open automatically, you can open it manually and navigate to `http://localhost:19006/`.