3 ms·
React 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 th
by chrisa 9y ago
React 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