Pros/Cons?
Pros/Cons?
I think the biggest pros of react native are:
1) Not having to compile to see UI/Business logic changes (Swift compiler is slow).
2) The ability to push changes over the air after you switch.
3) Large parts of your app just work cross platform with minimal changes (I've shipped two iOS/Android apps).
4) If you have a react web team, they can now review and help out with your mobile apps.
5) It's easy to keep product in synch across multiple platforms (i.e android/iOS release at the same time).
I think the big cons are:
1) It's Javascript.. ES6 + babel makes this a lot less terrible than it was in the days of web apps wrapped as native apps but it's still Javascript.
2) If you have to do long running background tasks (network polling, bluetooth, music, location, etc) you basically have to do it in native code. This can be a big architectural pain in the ass depending on what your app does.
3) Ramp up time. Learning about React and all the third party libraries (Redux, etc) you will need to be productive takes time.
4) Cross platform testing. I.e if you share code with your web/android engineers, they will need to be disciplined about not breaking things (npm and versioned shared libraries helps with this).
5) Third party library quality in Javascript land can vary a lot. This requires you spend quite a bit of time vetting them.
If your based in the Bay Area I'm going to be giving a talk on on some of this in March.
it works pretty well, but havent done anything other than syncing and notification pushing. other API s should work
EDIT - this fork looks like a good bet: https://github.com/ZhijieWang/react-native-workers
"the workers are paused when the app enters in the background the workers are resumed once the app is running in the foreground"
This won't work when your app is backgrounded or if the screen is locked.
Most apps I work on, and projects I see, could benefit from React Native.
The actually innovative ones, on the other hand, could not.
New view controllers continually being introduced by Apple and Google are not available in React Native. So if you want to get fancy with UX, you are out of luck. Or won't get a net benefit when you start doing native development to get around the limits of React Native.
If your app just pulls lists of items from a server and displays them, with pull to refresh and infinite scrolling being the most innovative parts? You should probably use React Native at this point in time.
Almost all of the "showcase" apps written in React Native (hosted on the Facebook page) aren't convincing showcases. Either because their UI is pretty bad / simple, or because they have only released on one platform. Townske is a pretty good example though.
It looks like this problem is acknowledged and addressed by the React Native folks[1] : React Native has several of the most critical platform components already wrapped, like ScrollView and TextInput, but not all of them, and certainly not ones you might have written yourself for a previous app. Fortunately, it's quite easy to wrap up these existing components for seamless integration with your React Native application.
If your app has some innovative UI, but you can reuse most of the code from React Native for some basic parts of the app, wouldn't you benefit from using React Native? Or is [1] not that "quite easy" ?
If you plan to have your app run on both iOS and Android (and Windows 10), what is the downside of React Native?
I wonder how React Native stands vs. Cordova and Xamarin, performance wise and ease-of-use. I'm thinking it falls somewhere in between Cordova and Xamarin, but I'd love to hear people's experience on this.
[1] https://facebook.github.io/react-native/docs/native-componen...
1) An example: It wasn't too long after iMessage apps came out in iOS 10 that tutorials emerged telling you how to use react native to build them, see:
https://medium.com/rendez-voo/messages-app-app-extension-ios...
2) It's really not that difficult to wrap native components and expose them to react native, see:
https://facebook.github.io/react-native/docs/communication-i...
I would say that Android is a little bit more work right now, but it's really not that big of deal.
3) It's easy to embed react native in an existing iOS app. This is great for things like sign up screens, call to action pop ups or other Areas of the app where you want to iterate quickly.
Also animations with react native are pretty nice. I haven't come across anything that I haven't been able to do yet. See:
https://medium.com/react-native-training/react-native-animat...
The biggest issue with react native is that its Javascript which a lot of native developers don't really like especially when compared to Swift.
Cons: - Fast moving project that is constantly updating (good and bad). Can be hard to keep updated and upgrading can be a pain - Documentation is ok but standard practices are missing
I'm sure other people have others...
But its really hard to argue with getting android as well for almost free, and even having the potential to share code with a web front end as well.
Especially when doing a version 1 of almost anything it seems to make more sense to me than any other option.
I did not have any experience with mobile development or React, and only knew Vanilla JS, none of that new fancy ES6 stuff. I was able to be comfortably effective with React-Native in about a month. On the first weekend, I had a usable sandbox/playground app compiling with hot-reloading enabled which sped learning along in a huge way.
We're a couple hundred hours into that project now, and I still find React Native to be a joy to work with.
Now, I wouldn't say that I'd go 100% of the way with react native, but so far I can say I'll be using it for at least 80% of my layouts/logic.