Why React Native is the Most Popular Cross-Platform Technology

As a mobile developer – what do you want in an application?

You want it to look slick. You want it to be super responsive with short load times. You want functionality on Android, iOS, and Windows.

What you actually want, is React Native. It’s the most popular cross-platform technology for a reason but before we delve into why using React Native is the best route for most developers looking for a cross platform rollout, it makes sense to touch base and reacquaint ourselves with the framework really quickly.

WHAT IS REACT NATIVE?

React Native is the open-source app framework created by Facebook – with none other than Zuckerberg himself at the helm. Mark has even admitted that the biggest mistake Facebook made as a company was to bet it all on HTML5.

As a result, the mobile version of Facebook released in 2012 was a laggy mess, prone to instability, and operated with the blindingly fast speed of a garden snail. Epic fail, talk about betting on the wrong horse!

The only way forward was to create a native, in-house framework that was JavaScript based. In 2015, a much smoother running Facebook app was released that allowed better integration with other platforms with substantially fewer problems. As you can guess, it was built using React Native.

There are some pretty obvious reasons why React Native is by far, the most popular framework for app development.

CROSS-PLATFORM

The big one we’ve already touched upon already, and that’s making sure that you get your app onto as many phones, tablets, and computers as possible. The framework uses a common JavaScript library to render your native app user interface and make it look the same across all platforms.

Generally, going full native would mean you have multiple teams working on the one app – one for iOS, one for Android, etc. By using a single codebase that can be shared across the platforms, it eliminates the need to use so many development resources – we’re talking simultaneous development here.

THE BRIDGE

React Native acts as a bridge between platforms in the same way that you use JavaScript to build a user interface for browser use. The framework itself uses Facebook’s JavaScript, but also JSX – an XML lookalike and coding language similar to HTML used to store and transport data based on rules and commands encoded into the document.

This bridge dictates the native rendering of the application programming interfaces for that particular platform, for example Objective-C for iOS and Java for Android. This ensures that the application uses real mobile user interface components, instead of using web views that come across looking scrappy and unfinished when they load in.

This gives the app a more customized and polished feel, and allows the integration of phone features and functions like the camera or locations services – if you wanted to. This makes it stand out from other cross-platform development tools like Cordova or Ionic that utilise web views using combinations of JavaScript, HTML and CSS.

THE ENGINE ROOM

App developers are working right at the coalface – they are the ones creating and fine tuning the product ahead of the release. It makes sense that a team of devs, acting like the engine room of the company, would appreciate their lives being made a little easier where they can.

React Native is surprisingly easy to work with, especially for those with a bit of experience using the original React to work on web portals. The tools are familiar, and incredibly quick to pick up for the uninitiated.

Error messages are descriptive, and all mean something – a welcome change from generic fatal errors that leave devs scratching their heads and going back to the drawing board. When your application crashes during testing, you’ll know exactly where the problem is and why it happened. Super easy to go back and tweak.

The error reporting is top notch, and React Native has on board intelligent debugging tools that you should absolutely be taking full advantage of.

FLEXIBILITY IS KEY

For developers that are more comfortable working with Chrome or Safari dev tools – good news, you can use them for mobile development using React Native. You can use whatever text editor takes your fancy for JavaScript editing.

React Native doesn’t force you to write in Xcode for iOS, or Android Studio for Android, which is a nice ease-of-convenience feature.

FAST RELOADS

Because its JavaScript based, you don’t need to rebuild the app in order to make changes to it. A simple Command+R is all that’s needed to refresh the application just like you would a web page. The 5 minutes waiting for a rebuild can really add up to time wasted, and a quick iteration cycle can really be a godsend if you’re on a tight schedule and don’t have a moment to lose.

GETTING ACROSS THE FINISH LINE

The App Store is notoriously slow for pushing through updates and hotfixes. Using React Native will leave a positive impact on your release and update cycle, with less angry users spamming you about the same known bug you’ve fixed but are trying to patch.

Apple permits JavaScript based changes to an app to be loaded through the store with no additional reviews – meaning much faster minor updates. It’s something small that actually amounts to saving you time and energy, and turning your focus to other more productive areas of the project.

IT RUNS CONCURRENTLY

React Native works separately from the main user interface thread instead of them being bundled into one, retaining high performance and keeping loading times to a minimum. When the app needs to be updated, the framework draws upon the user interface libraries of the host platform as a dedicated process, totally separate from the application process.

COMMON SKILLSETS

When you boil it down, React Native prevents the need for an overly diverse development team, as you just don’t need the same individual specialties you do when attempting to create your own native platform from scratch.

Literally any dev who knows how to work in React from their web experience, is now able to build in iOS and Android. The inverse applies, mobile developers can make the jump to web development with next to no learning curve. The skillsets are the same, eliminating the need to recruit based on experience in a particular platform.

The added benefit is because the React skillset is universal, the team as a whole can share knowledge and resources more effectively as there is more common ground. There will still be a need to write in Objective-C or Java that is platform specific for app functionality and unique features, but it isn’t that bad.

For example, the Facebook Ads Manager for Android shares 87% of it’s codebase with its iOS counterpart. Some apps share 100% code base, which is mighty handy.

THE DOWNSIDES

This isn’t a sales pitch – it’s an honest review. Just like everything in life, there are benefits, risks, and drawbacks. React Native is great fit for most teams, but may not be suitable to every circumstance or situation.

IMMATURITY

The largest potential risk with using this framework to build your application is its age. iOS support for React Native was released in March 2015, with the Android support released in September.

Even though the continuous improvement is there, the framework isn’t without its issues, bugs, and gremlins. The documentation in particular needs some pretty big attention, and has a lot of room for improvement.

The release of new tools in the Redux and Reflux libraries designed to accelerate the work of a library or improve the React system as a whole ultimately struggle, as integration of these tools with React JSX isn’t executed well.

The feeling is that React technologies and tools are updating so quickly and so frequently that there is no time to write proper instruction. Most developers have to resort to writing their own documentation for specific tools used in their projects as a solution for this poor integration.

NOT ALL ENCOMPASSING

Despite the evolution of React Native, it still doesn’t support certain features on iOS and Android. If that sounds crazy, it’s because it is. The good news is that any developer worth their salt can code in support for the missing application program interfaces themselves. Although not ideal, it’s something that would only be a relatively seldom occurrence – for the most part, support is excellent.

DE-BUGGING

We’ve spoken about the powerful debugging tools built into React Native, and for the most part, they do a fantastic job. In saying that, there will be times where you’ll be pulling your hair out trying to figure out what’s making your application crash or misbehave.

Because React Native adds another layer, and a separate process thread, to the app it introduces another interface for problems to occur in – especially at the intersection of React and the host platform, whether it be Apple, Android, whatever.

Overall, the benefits far outweigh the negatives. While the debugging process in React Native is very good, be prepared for the odd hairy one that will test your patience and push your frustration to its limits. But that’s coding for you.

CONCLUSIONS

To bring it all together, React Native draws upon the existing JavaScript knowledge of the developer to create applications by efficient code sharing between iOS, Android, and the Web. Because it lays a common foundation, it eliminates the need for platform specific specialists in the development team.

The result is a much faster research, development, and rollout cycle. The end user’s experience is all quality, as from their perspective, the application looks like it’s been cooked up in-house from scratch. But beneath the surface, the React Native framework makes it super easy to make the app look the same across all platforms, and helps with brand uniformity.

The drawback is that the technology is quite new. There are still a few kinks to iron out, which is to be expected. Those looking to create an application for one platform only should still look to recruit based on specialty in that field. Despite this, React Native remains one of the most popular cross-platform technologies for mobile app development and it’s clear to see why that is.

Kofi Group is proud to be a source of knowledge and insight into the startup software engineering world and offers a multitude of resources to help you learn more, improve your career, and help startups hire the best talent. If you are interested in learning more about what we do and how we can help you then get in touch or watch our Youtube videos for additional information.

Try our other blogs on coding, like  “The 10 Top Programming Languages of All Time” or if you are curious what it’s like to work in a startup environment check out “The Truth About Being a Software Engineer at a Startup”.