What React Native Means for CTOs
:: By Paul Francis, The BHW Group ::
As anyone who has led a development project can tell you, there are dozens, if not hundreds, of ap-proaches to consider. Project owners have to decide what languages, frameworks, technologies, ser-vices, and environments their solutions will utilize and be built with. Although mobile apps are a more recent invention, there are already several established options for mobile app development. These options can typically be broken up into three main categories: platform-specific native, cross-platform hybrid and cross-platform native.
The Shortcomings of Existing Options
Before discussing what React Native is and the problems it tries to solve, it is important to understand why a new approach is necessary. A common trap that derails many developers and managers is using a new technology simply because it is new. Before hopping on the React Native train, you should under-stand how it differs from the existing options.
Shortcomings of Platform-Specific Native
Platform-specific native is, in many ways, the traditional approach to mobile app development. Apps written in this manner share little or no code between operating systems and are typically written using Objective-C or Swift for iOS and Java for Android. Apps written this way can be highly tuned for performance and are first-class citizens on the device. They can easily interoperate with other apps on the device, can use native UI elements, and access platform specific entities (file systems, databases, compass, etc.) with direct interfaces. The downside of this approach is fairly obvious. If your app needs to be on multiple platforms, developing those independently becomes increasingly expensive.
Shortcomings of Hybrid
Apps built using this approach can be cross-platform, which means you can share most or all of your code between operating systems. The great benefit with Hybrid is it is often much more cost effective. However, hybrid apps have a lengthy list of shortcomings including poorer performance, non-native UI elements, a reliance on third-party (often buggy) packages and some risk of technology abandonment. Hybrid apps can be a great approach, but always make sure you consider more than the initial price tag before kicking off a hybrid app project.
How React Native is Different
React Native, like hybrid apps, is cross-platform, which means code can be shared between operating systems. Unlike hybrid apps, apps written with React Native are actually native. This “best of both worlds” summary is why there is currently a ton of buzz around this framework.
Any seasoned developer, manager or CTO should be somewhat skeptical at this point. Every day, new frameworks are being released that claim to be the new best approach. There are many questions that need to be asked about React Native and this article will explore several of the major ones. Many of these sections, could be their own articles, or perhaps even books. We will do our best to provide succinct answers.
How Does React Native Work?
Does React Native Feel Native in Terms of UI?
One of the greatest weaknesses of hybrid apps is their non-native user interfaces (UIs). React Native does a great job of eliminating this problem. In the previous section, we discussed how React Native renders native view elements. A component can typically be written once, but function and feel just like a native app would on both iOS and Android. Hybrid apps typically look like one iOS on Android or like a web application. You should not be able to tell if an app is using React Native or not, which is exactly the point.
How Much Code Reuse do you Actually get Between Platforms?
React Native’s app logic and component interfacing should almost always be 100 percent shared between platforms. Furthermore, the rendering code can typically be completely shared as well. This is a large reason why the community is finding that they get about 80 percent code reuse between plat-forms.
In the event that you do need to write platform-specific code, you can either use some sort of “If iOS then…” logic in your component or have two component files with similar names (MapScreen.ios.js and MapScreen.android.js for example) that conditionally render based on the platform in use.
In the event that you do need to write some additional platform-specific code, it is exceptionally easy to wrap those native calls so that they can be called from your cross-platform code. This can be useful when working with maps and things like Apple Health Kit. This also means you can use React Native to extend existing native applications.
What is the Learning Curve of React Native?
How Does the Development Cost Compare to Hybrid and Platform-Specific?
Cost is something that can vary significantly between projects. It is always dangerous to say, “doing it this way costs X, this way costs 2X, and that way costs 5X.” The reason for this is that some apps would cost the same with all three approaches, whereas others are not even possible using one of the methodologies.
In general, hybrid apps are the cheapest approach, followed by React Native, then platform-specific.
What Does React Native Mean to You?
React Native is an exciting and attractive option for most mobile app development projects. However, it is still new (particularly on Android) and as such is still evolving. Additionally, finding React Native developers might be difficult and it is very likely that they will only have a few React Native apps to show off at this point. That being said, we believe that with the current React Native development team at Facebook, the continued community growth, and the benefits discussed in this article, React Native will be a major player in the mobile development world for quite some time. Any CTO would be remiss to not thoughtfully consider React Native for their next mobile app development project.
About the Author
Paul Francis is a partner at The BHW Group (a Web and mobile app development company based in Austin, TX). There he works with clients throughout the app design, development, deployment and marketing processes. He has worked on platform-specific native, hybrid and React Native projects. He writes fre-quently about the technical and business sides of mobile app development. If you are looking for some help on your next mobile app, feel free to reach out!