Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can React Native apps be tested in a browser?

Realizing that React Native apps are designed to be developed / tested using simulators, is it possible to use a web browser to also test an application?

Services such as https://rnplay.org/ exist, however my concern is it's powered by https://appetize.io/ it might be limited by the # of minutes per month. I'd also like to utilize free / open-source technology to accomplish this, as compared to a paid screen streaming service.

Along these lines, in order to test the app in a browser, would the app be required to use one or more libraries which allow the app to be run in both React Native and also simply React? I'd like to find an alternative to this particular approach as I'd like to code for React Native specifically.

like image 699
sean2078 Avatar asked Mar 13 '16 18:03

sean2078


People also ask

Can I test React Native in browser?

Can React Native be used for web and mobile? Yes! With React Native for Web, developers can write a single React Native application that can run natively on Android and iOS, as well as on a web browser using standard web technologies.

Can we run React Native online?

You can code, learn, build, run, deploy and collaborate on your React Native projects instantly from our online browser based Cloud IDE.


3 Answers

No, React Native can be tested only in mobile simulators like IOS and Android

Update: Facebook has given a beautiful starter pack for React Native.

Introducing Create React Native App

Using this, you can run the app in your mobile using expo app(https://expo.io). It syncs using QR code.

like image 165
Thanigainathan Avatar answered Oct 02 '22 23:10

Thanigainathan


Yes! That's very much possible with react-native-web. Here are a couple of related, useful resources to get started:

  • React Native Web Starter
  • A guide to combine React and ReactNative into one codebase
like image 24
Umar A. Avatar answered Oct 02 '22 22:10

Umar A.


You can use Expo Snack https://snack.expo.io/ to instantly test your code on a device (using QR code ) or in the browser. For more information, you can go thtrough this article. https://blog.expo.io/sketch-a-playground-for-react-native-16b2401f44a2

like image 33
Ankit Sinha Avatar answered Oct 02 '22 23:10

Ankit Sinha