3 ms·
Discord is actually an extremely complex app and run almost entirely off React Native, with 2 engineers, only 1 of which who is an iOS expert :P! We have millio
by victoriasun 8y ago
Discord is actually an extremely complex app and run almost entirely off React Native, with 2 engineers, only 1 of which who is an iOS expert :P! We have millions of users, and we typically rank in the top 10 of Social Networking on the iOS App Store. We are excited to share our success story of being a "big" company using such a product.
- deleted 8y ago[deleted]
- jrumbut 8y agoI was very surprised to hear discord used RN because I found that I had to break down and use native code to deal with a lot of multimedia and a few other things that aren't just displaying text. I still loved RN, I just maybe naively hoped I could do everything with it. Is that your experience too, that a good bit of native code is required (with RN serving as glue and handling simple screens), or have you avoided that somehow?
- victoriasun 8y agoPersonally I have found that RN does require some amount of native platform knowledge to be successful. However, the bulk of our app is actually in React Native. The times we've had to bridge into native is mostly around our voice modules or things that, in RN, were not very performant (like poor list performance) or required synchronous updates (like the keyboard problem mentioned in the post). Certain multimedia objects RN doesn't support out of the box but the community has come to the rescue (ie: https://github.com/cornedor/react-native-video-player https://github.com/cornedor/react-native-video-player for video).
- QualityReboot 8y agoI agree with all of this, but I'd add that bridging RN to Native is not as scary as it sounds. Check out the code examples: https://facebook.github.io/react-native/docs/native-modules-ios https://facebook.github.io/react-native/docs/native-modules-... In practice, most of it is wrapping "RCT_EXPORT_METHOD" around native code and importing it into JS. Even if you had to write half the app in native code (which you won't), you're still far ahead of having to write it all in native code on both platforms.
- laex 8y agoAgreed. Creating bridging modules aren't that complicated. For anyone interested, I've linked a sample of a bridging module from my open-source project, for both IOS and Android. See [0] & [1] The bridge creates an interface between an embedded webserver to react native. Things to note: 1. Always dispatch bridging methods to their own threads. On IOS you can do this via. dispatch_async. On Android, you can utilise native threads or some kind of task management library. I like Bolts [2]. 2. Always create bridging methods that resolve promises. This makes it easy to utilise async / await paradigm on the JS side. [0] Android: https://github.com/hemantasapkota/react-native-web-server/tree/master/android/app/src/main/java/com/reactnativewebserver/AppWebServer https://github.com/hemantasapkota/react-native-web-server/tr... [1] IOS: https://github.com/hemantasapkota/react-native-web-server/tree/master/ios/ReactNativeWebServer/AppWebServer https://github.com/hemantasapkota/react-native-web-server/tr... [2] Bolts: https://github.com/BoltsFramework/Bolts-Android https://github.com/BoltsFramework/Bolts-Android