92

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.

4
  • 3
    limited, but something to play with: npmjs.com/package/react-native-for-web Commented Sep 12, 2016 at 9:04
  • thanks @tokland will check it out - I think there will come a day when we can build natively using faster environments than simulators Commented Oct 1, 2016 at 15:01
  • 5
    So much for naming this a 'write once run anywhere' ! Commented Jul 28, 2018 at 14:19
  • sandbox might be a good alternative choice codesandbox.io/s/loving-wind-ftpq0 Commented Mar 2, 2020 at 3:01

3 Answers 3

53

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Just a note on some Expo restriction for impoverished developers: Expo's IDE on Windows requires 64-bit. On MacOs the IDE requires you to log in on the internet. So far I have not succeeded in getting Expo to send a build to my USB-connected Android device from the commandline without internet but it may turn out to be possible ...
Working well for me
27

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

2 Comments

Interesting.. I guess they expect all the code to be written using native tags.. Need to check if we can actually UI properly with all its quirks in a browser or not..
excellent, pls note this need to be the top answer as this is an affirmative
17

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.