Can we share code between react webapp and react native app and is react-native production ready

react-native, reactjs

Solution

Instagram, Tesla, AirBnB, Discord, Bloomberg all have production apps written in React Native. I'll let you decide for yourself whether it's production-ready in your opinion.

While React Native enables you a significant code reuse between iOS and Android (we are currently building an app for client which - appart from external libraries - reuses over 99% code between iOS and Android), it is not designed to share code with React webapps.

The Facebook's philosophy with React Native, instead of write once, run anywhere is rather learn once, write anywhere.

You can definitely use your designs and architecture, but you would need to rewrite most of the code. It might still be more efficient than developing two separate Java and Obj-C/Swift apps, though.

Update: In 2018 Airbnb decided to sunset React Native in their production apps. They wrote an insightful article about their experience and reasoning. It is very relevant for anyone thinking about using React Native. https://medium.com/airbnb-engineering/react-native-at-airbnb-f95aa460be1c

Problem

We have a stable version of a widget developed with reactjs. We would like to develop mobile version of the same. Is it better to develop with react native and share the code across the 2 apps or is it better we develop the widget natively. Bare in mind that we do have expertise in both(react and android dev) but we do not want to invest to much time on developing the entire app again. Are there any tools/resources available to get this done faster if we choose react-native? Resources available online: http://jkaufman.io/react-web-native-codesharing/ https://arielelkin.github.io/articles/why-im-not-a-react-native-developer.html https://medium.com/@felipecsl/thoughts-on-react-native-from-an-android-engineers-perspective-ea2bea5aa078 Cheers!!!

Original source