By using the native layout components, React Native allows you to create compelling UIs that are indistinguishable from a native app (Android or iOS). The code is shared across these two different code bases, but for the layout i-e the design elements like views, styles etc , you use native components of each platform. That is where the JSX markup comes in. JSX is used to create the layout for either iOS or Android, by using the respective native components, thus the name React NATIVE.
Quite popular for a native app development framework, I am going to explore the Pros and Cons of React Native, to create a better understanding of what and where can React Native be used for.
Pros of React Native
Design and layout feels a lot more productive if you are quickly able to visualize what you create. For that very purpose, React Native has a great feature called “hot reloading”. It allows the changes made in the code to immediately take effect into iOS and Android app variants. It’s like a live preview!
This reduces the waiting time for changes to show up to zero and saves further development time as well.
By using native controls and native modules, React Native improves on performance.
React Native interacts with the targeted (native) components for iOS or Android and renders code to native APIs directly and independently. In doing so, it uses a separate thread from UI, which results in increases the performance. The key factor here is React using the native APIs. Other options like using a WebView to render code may have other advantages, but compromise the performance.
As I mentioned above, React Native is an open source project. That means anyone can contribute to the framework. It also means you get to have a more approachable access to great developers and their experience. If you are facing any issues, you have high chances of getting the right kind of help from the community and experts.
Ready-made Components Increase Development Speed
Another great feature on the React Native table is the ‘Ready-to-apply components’. Instead of writing code from scratch, you get to use ready-made components. They are great for achieving simple forms of functionalities. It not only makes the development process simple but also faster.
React Native can save big on money as well as time.
This approach is cheaper and more budget-friendly because you don’t need to hire separate developers or teams for different development targets. One developer codes for two platforms – That is less amount of resources and costs spent on building the same apps with smaller development cycles.
Short Team Size
Building up on my last point, when one developer codes for both iOS and Android, it evidently reduces the team size as well. Apart from this being a great advantage for not needing to learn two different languages and platforms, it adds in great with a smaller team size too.
Yes, there might be times when apps with more native features will require help from native developers but in most cases, you will have a smaller team and it will be easier to manage.
Reliable and Stable Apps
You needn’t worry about the stability and reliability of Apps built with React Native. It simplifies data binding with such flow that the child elements cannot affect the parent data. If the developer wants to change any object, he/she would have to modify its state and apply updates accordingly – meaning only allowed components will be upgraded. Great companies like Facebook, Instagram, Airbnb, Skype and a lot more are using React Native for their apps! That, in itself, says quite a lot about the quality, stability and reliability of apps created using React Native.
Ability to Target Multiple OS with Less Native Code
The ability to create one app running for multiple OS is just great. No matter the simplicity because you might not get all the features or advanced functionality in apt packages for apps created with React Native, but nonetheless, you will have two applications with the time, effort and resources for creating one.
I would always add this to my list of Pros of React native.
Better than Hybrid Native Experience
React Native offers a truly native user experience, unlike other hybrid tools that merely provide a native-style wrapper for browser-based apps. Since React native leverages the native components, the final products look and feel very real – as if created with the same native technology. If you are unaware of the technology used to build an app, you will not be able to differentiate between a simple app built with React native or an Android programming language or iOS.
Cons of React Native
Ready-made Components Small Collection
Ready-made components are React Native’s one of the most prominent pros. It’s a shame there are only a few. Although, it’s still a new development framework and that the number of ready-made components is expected to increase drastically, but at the moment the collection is quite small.
That limits developers to creating very basic simple apps.
Native Code Required
Earlier in this article, I mentioned that you might still need to write a minimal amount of native code when developing apps with React Native. This feels like a contradiction, because for someone developing in React Native, avoiding having to code for Android or iOS was probably what they were doing in the first place. This is something you will also need to budget for, especially if your app requires access to device cameras and other onboard hardware. In a rare case, this might out-weigh all React Native pros like a smaller team, time saving, cost reduction.
App Performance Lacks as Compared to a Pure Native App
If you are making a simple app, then sure go ahead – you can use the full benefits of React Native.
However, if you require some advanced functionality, then performance might go down the drain in comparison to apps created with platform-specific logic.
I mentioned the small collection of read-made components. That is not a dead end, as there are third-party component libraries that you can choose from. But that would depend on luck, in terms of quality and reliability of that specific 3rd-part library. As they are not created by the official developers, they might contain a lot of bugs and glitches. You spend time correcting those but it would be more productive if you wrote code from scratch, thus, once again defeating the purpose of avoiding platform-specific coding.
Steep Learning Curve
Especially if you are using any 3rd-party add-ons.
In Conclusion, React Native is a great framework for everything simple and fast – like apps with lists, lotteries etc, anything more complex than that will, most certainly, require more resources. BUT the rate at which the React community is growing, everything that could be holding this framework down, has high chances of changing. Especially as the component collection grows, it is highly likely that more advanced functionality will be introduced and catered to.
Quite recently, Facebook’s license agreement changed from a BSD Patents License to an MIT License, opening roads to a more wider adoption of React Native. This very factor was, at a point one of the cons of using React Native.