5 ms·
What do you dislike about ReactNative?
by htormey 9y ago
What do you dislike about ReactNative?
- ryanwaggoner 9y agoTo be fair, I didn't spend a ton of time on it and I'm probably wrong about many of my impressions, but... My impression is that it's "native" only in the loosest sense of the word. On iOS, it creates a single view controller and then draws everything in there, I guess technically with UIView objects? But there is no use of native controls, so you're at the mercy of whatever crappy controls someone has created. Quality is seriously lacking for most of those. Essentially zero adherence to the greater platform standards or settings. Feels exactly like Java applets or Flash sites from the 90s. Blank canvas, roll your own everything. I guess the drawing of whatever you want is fast, but that doesn't make it "native". A glance at the dumpster fire that is the "navigation controller" situation is enough to turn me away. There's still not even a standard way to handle multiple views and the transitions between them?? Also, I really dislike Javascript. Why would you prefer to write code in JS instead of Swift? The entire npm / dependency / build situation also felt incredibly brittle. Felt like if I came back to this app in 6 months and touched anything, there was basically 0% chance it'd still work without a ton of fiddling with dependencies, etc. It just seems terrible. I basically agree with most of what's written here: https://arielelkin.github.io/articles/why-im-not-a-react-native-developer.html https://arielelkin.github.io/articles/why-im-not-a-react-nat... (this also ignores all the baggage that any non-native platform faces, no matter how good. things like: feature lag, crappy and non-native UI / UX, more pain during debugging / optimizing, extra layer of bugs to deal with, lower community and support, etc, etc.)
- chrisa 9y agoReact Native actually does use native controls - when you say you want a ScrollView for example, you're getting a real native scroll view. That is one thing that makes it different from many other cross platform libraries. It is true that not everything is wrapped, but if you run across something you need, it's not that bad to create the wrapping yourself; here's more details: https://facebook.github.io/react-native/docs/native-components-ios.html https://facebook.github.io/react-native/docs/native-componen...
- ryanwaggoner 9y agoInteresting. Then why does everything look and behave so poorly? And if it's so easy, why doesn't React Native ship with at least every default native control wrapped? Edit: what a beautiful example of what I'm talking about: https://github.com/facebook/react-native/issues/371 https://github.com/facebook/react-native/issues/371
- chourobin 9y agoI had many of your concerns early on but having just built an app in react-native, I think those concerns gradually went away. If you're a native developer, it should be relatively easy to get the app to look and feel great.
- chrisa 9y agoIn terms of poor performance: while it is possible to get good performance, the naive implementation of features might give you (accidentally) bad performance. For example: if you have a list of 1,000 things, you might put them in a scroll view first; but that will lead to very bad loading and scrolling performance (it will with straight native code as well). Instead, you should use FlatList (https://facebook.github.io/react-native/docs/flatlist.html https://facebook.github.io/react-native/docs/flatlist.html) which is built to be performant on long lists (by reusing components, etc). There are also a few additional considerations that you don't have when writing pure native code. One example is that if you send a lot of data (like a huge image) over the JavaScript bridge, then that can really slow down app performance. There are ways to get around that however, but it can be easy to accidentally do things like that which hurt performance (and those types of slowdowns might be confusing and difficult to track down). So yeah, it's not perfect - but it's the best cross platform development tool I've used, and most potential issues have workarounds (once you learn what's causing the issue).
- wlesieutre 9y agoYes and no. It uses a native ScrollView, but you don't have direct access to all of the standard UI views like UICollectionView. People use custom reimplementations to get the same capabilities. Generally won't be 100% accurate to the native versions, but at least it's better than when people were writing cross platform applications in Java with the menubar at the top of the window instead of in the menubar. https://github.com/lucholaf/react-native-grid-view https://github.com/lucholaf/react-native-grid-view
- htormey 9y agoAll of what you said are pretty reasonable concerns. Basically React Native makes a lot of sense if you have a React web team. In this scenario it works well if you want to spin up an app from scratch or for growth related stuff within a brownfield application. It makes no sense for a native only shop. “But there is no use of native controls, so you're at the mercy of whatever crappy controls someone has created. Quality is seriously lacking for most of those. Essentially zero adherence to the greater platform standards or settings. Feels exactly like Java applets or Flash sites from the 90s. Blank canvas, roll your own everything. I guess the drawing of whatever you want is fast, but that doesn't make it "native".” This isn’t entirely true. You can wrap any uiview and embed it in the React Native view hierarchy. So you have a lot more flexibility than say Cordova (I.e where your ui is a big web view) Even if you do full native, you run into the same problems. I,e you are going to either use something from cocoapods or roll your own. I’ve seen plenty of half baked third party native libraries. “Also, I really dislike Javascript. Why would you prefer to write code in JS instead of Swift? The entire npm / dependency / build situation also felt incredibly brittle. Felt like if I came back to this app in 6 months and touched anything, there was basically 0% chance it'd still work without a ton of fiddling with dependencies, etc” To avoid having to deal with writing an Android app from scratch ;) I’m a native iOS developer, I mainly got into React Native last year because of all the issues around swift leading up to 2016 wwdc. This years it’s much better and I’ll probanly spend some more time learning it now that it seems stable. However I think it’s unfair to pretend that the last few years of swift have been a smooth ride. Modern JavaScript is a lot better than it was 4 years ago. However I totally understand why you would not be into it.
- ryanwaggoner 9y agoEven if you do full native, you run into the same problems. I,e you are going to either use something from cocoapods or roll your own. I’ve seen plenty of half baked third party native libraries. This is true, but: a) you have a base set of excellent native controls provided by Apple, and b) you have a much more mature community providing third party controls.