I'm a software developer based in the UK. I am blogging regularly about software development & Apple

A closer look into React Native

I hear more and more people these days talking about React Native. So I decided to share my thoughts from a native developer's point of view.
First of all, what is React Native? React Native is a framework that allows you to write iOS and Android apps using JavaScript. The important bit to note here is that a React Native app is a native app that directly runs on a device's hardware in contrast to a hybrid app which partially runs in a web view.
It's not the first time there was a technology that promised to write code once and deploy it anywhere. It's already been done with web apps and cross platform development tools like Xamarin or Titanium which all have problems of their own. But as I said, let's take a look at React Native here.

Advantages

  • develop once, run anywhere

As I said before, React Native allows you to develop once and run the end result on iOS and Android. Hence development efforts along with associated costs are in theory cut in half compared to writing one native iOS and Android app

  • Live Reload / Hot Module Reload

React Native has a sound development environment with its most prominent features being Hot Module Reload and Live Reload. These enable developers to see the result of any code change nearly instantaneous without the need to recompile the app. This again cuts down on development time and costs.

Disadvantages

  • licensing issues

Not so much a disadvantage at this point any more but still worth noting were issues around its licensing terms. Facebook clarified and this doesn't seem to be a problem any more for companies willing to adopt React Native. It nonetheless led the Apache Software Foundation to ban its use.
As a native developer you are depending on Apple's good grace to let your app into the App Store. With React Native there is just one more dependency in the form of Facebook not changing their licensing terms to your disadvantage.

  • support

React Native was born out of hackathon some two and a half years ago. Will React Native still be supported in a year or two? Developers putting all their money, time and effort on React Native should be aware that Facebook never committed to a roadmap. Facebook's decision to support it now doesn't mean they are going to do so in the future. Who knows what comes next? We are living in fast changing times where the next hot framework is just a hackathon away.

  • rapid development cycles

Rapid development cycles cause APIs to change quickly. Until now there have been some 50 React Native stable releases. Do you remember the pain going from Swift 2.x to Swift 3. You basically have two choices here: Either you update every 2-3 weeks to a stable release and go through a minor regression or you do it every once in a while but then need to put aside 1-2 days to update your app along with a major regression. The choice is yours.

  • framework dependency

Every software has bugs and so does React Native. At the time of this writing React Native has more than 500 issues and quite a few of these issues are crashes. With React Native there is one more component that can crash your app.

  • Apple Developer Program License Agreement

With React Native being based on JavaScript there is some likelihood of Apple blocking React Native based apps due the potential of changing runtime behaviour with code injection. Apple Developer Program license agreement, Section 3.3.2 states:

"Except as set forth in the next paragraph, an Application may not download or install executable code. Interpreted code may be downloaded to an Application but only so long as such code: (a) does not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store, (b) does not create a store or storefront for other code or applications, and (c) does not bypass signing, sandbox, or other security features of the OS."

So far only React Native's code-push feature was affected by this. The way I see it, it only takes one major incident for Apple to revise their policy in regards to React Native Apps.

  • scalability and maintenance

Let's face it: writing software is easy but writing scalable maintainable software that needs to be managed by constantly changing software development teams is hard. This is amplified by the fact that finding good developers is hard. With React Native you need to know JavaScript, ReactJS, iOS and Android. Finding developers that fulfil those criteria is even harder. Sourcecode of a lot of native apps tends to transform over time into a big ball of unstructured code if stringent code refactoring doesn't take place. Not knowing any of these technologies might tempt developers to apply work arounds that leads to this unstructured code soup.

  • JavaScript

Apple introduced Swift because it wanted to endow developers of their platform with a modern feature rich language. A lot of companies welcomed this decision and didn't hesitate to get their apps converted to Swift. From this point of view writing apps in JavaScript is a step backwards. Why write software in an unsafe language? I don't want go into JavaScript's deficits here since this article provides an excellent overview of what those are.

Conclusion

I understand that a lot of web and Titanium developers are attracted by it since it uses the very language they are familiar with. If I was in their shoes, I probably would do it as well since it broadens the portfolio of apps I'd be able to support. But that aside, considering all the disadvantages, it doesn't make any sense to base your next app on it.

A company that only has limited development budget should not do it since the inherent risk of it being deprecated soon is just too big. A company that already has an iOS and Android app should not do it either since the cost of writing something new is always greater than maintaining something e.g. what about all those unit tests? There is also the option of using one app, iOS or Android, and gradually add React Native support to it. This can of course be done but I can't imagine an outcome of which there isn't a big mess of unstructured code at the end of the transition.

React Native is a step in the right direction. The amount of people willing to give it a try shows that there is a huge demand for a technology that enables cross platform development. But with JavaScript being the foundation of this technology, I am not able to see a promising future. If there was a modern language at its foundation, I'd definitely jump on the bandwagon. Instead I rather wait for next technology that is just a hackathon away.

Server-side Swift with Kitura

A seatbooking system based on Scene Kit