4 ms·
Options like React-Native When you use React for a web app, how close are you to turn it into a React Native app?
by TekMol 9y ago
Options like React-Native
When you use React for a web app, how close are you to turn it into a React Native app?
- chii 9y agothe hearsay is that if you used only components that are available for both, it'd take very little extra boiler plate to get it working on both native and web. But all non-trivial apps have their own components and that's what makes native difficult.
- nathan_f77 9y agoThis is not really true, the react-native-web project provides compatibility for all of the fundamental components that you need, such as View, Image, ScrollView, TouchableOpacity, etc. There are still some missing components [1], but nothing I really needed (or couldn't work around). [1] https://github.com/necolas/react-native-web/issues/91 https://github.com/necolas/react-native-web/issues/91
- zackify 9y agoThis really isn't the case. I have built apps with lots of code reuse on native and web. Abstract all data logic and you can use the exact same code for both apps. This of course does not include your view layer. If you do it correctly, all you have to do is make a new set of view components. Stateless ones. Because you are injecting the state from your non platform specific components. It makes it extremely fast to build for other platforms. It just takes a few apps to fully understand how to abstract these things perfectly.
- k__ 9y agoI'm a freelancer, so I do different projects. Web, Mobile, etc. Now I can do them all with one framework.
- t1amat 9y agoIf you stick to using `react-native-web` components to design your web UI then your app is likely compatible with React Native and can be run as a mobile app in addition to deployed as a web site.
- Double_a_92 9y agoDo you remember when the first iPhone was released and one of its main marketing points was that it could browse the REAL web? ... Nowadays we are crippling the real web (or at least it's design) so we can have a version for small screens. Oh the irony :(
- deleted 9y ago[deleted]
- nathan_f77 9y agoIt's difficult to convert a React web app into a React Native app, but you can use many React Native components on the web (via react-native-web. [1]) In other words, you can't run a web app on mobile, but you can run a mobile app on the web. I just launched a little game that I built with React Native [2], where I have a single codebase that supports iOS, Android, Windows, and web. [1] https://github.com/necolas/react-native-web https://github.com/necolas/react-native-web [2] https://sudoblock.com https://sudoblock.com
- dabit3 9y agoIt's less about code reuse across a full featured web application and a mobile application. The value comes in that once you master React or React Native, you can easily switch across platforms and be just as efficient. If you learn the ins and outs of Vue and gain depth of best practices / domain knowledge, you are stuck building only for the web. If you do the same with React, you are then able to take those skills and build VR, Web, iOS, Android, Windows, and soon TVOS ++ many more in the future. This, along with what has already been stated, is the value of using React vs Vue imo.
- gustojs 9y agoI don't see an issue of learning Vue and not being able to write native apps for iOS and Android as a valid one. Weex quickly gets better and is maintained by Alibaba, a company of the same scale and with development resources comparable to Facebook or Google. NativeScript recently started work on Vue port, the project is already available for testing. That's excluding the Cordova solutions like Onsen and Framework 7 having official Vue ports. To that, PWA slowly becomes the new trend for mobile development, native apps are not necessarily the optimal solution to every use case. The "++ many more in the future" is an optimistic assumption. As much as I wish it to be fulfilled, same can be said about any other framework.