API Development

Airbnb Sunsets React Native: What Does It Mean for Cross-platform App Development?

Over 10 years, on-demand lodging and hospitality startup Airbnb has grown their offerings from a simple webpage to a world-class mobile app. Understanding today’s need for an exceptional mobile experience, the company expanded their mobile app team to more than 100 developers. They also enlisted the help of React Native in 2016, in order to ship code more quickly by harnessing the power of cross-platform development.

Cross-platform technology can be a critical tool for development teams (both young and established), allowing them to build powerful mobile apps with a native user interface. When done right, it can help companies move faster, share a single codebase across platforms, avoid cycles of rewriting code, and assure app quality—all while improving the developer experience.

So, for some, it came as a surprise to hear Airbnb announce, following a series of blog posts on Medium, plans to sunset React Native in favor of reinvesting efforts back into pure native mobile development.

What worked, and more importantly, what didn’t

Airbnb explains that it was able to accomplish many of its of cross-platform goals in concert with React Native. For example, its engineers explained that through cross-platform, the development team was able to create a unified design language system (DLS), iterate more quickly, and of course, build cross-platform, native apps.

However, the company noted that while it worked well in most situations, there were instances in the process that made developing something that was trivial in native, very difficult for cross-platform. That list included troublesome crashes and bug monitoring, painfully slow initialization and render times, non-negligible app sizes, 64-bit support issues and problems with accessibility and upgrading React Native.

These types of issues were said to be hard to predict and could take anywhere from hours to days for the Airbnb team to work around. As the development team went on to explain, that process is not conducive to the speed required to keep pace in today’s mobile landscape.

After reading through their blog posts, it’s easy to come to the conclusion that cross-platform isn’t the best way to develop mobile apps. However, Airbnb’s experience with React Native was not so much an issue with using cross-platform in general, and more to do with how it was implemented in this particular case.

What Airbnb was trying to accomplish through cross-platform was actually both unusual and bold. Their development team was attempting to write components and sections of the app in React Native and then merge these into existing native apps.

The thought was that certain features of the app could be developed with a single codebase and then added to both the Android and iOS apps, allowing them to move faster by updating both platforms at the same time.

This is certainly a unique way to develop apps using a cross-platform framework, and whilst React Native allows this kind of integration, it wasn’t particularly easy to work with.

So, instead of developing a cross-platform app from scratch that shares 90%+ of the same codebase, Airbnb attempted to inject cross-platform elements into pre-existing native apps. And, as explained in the five-part series, this ended up with them managing three separate codebases: iOS, Android, and cross-platform.

A safer approach to cross-platform app development

Airbnb’s decision to re-focus their efforts squarely on true native app development has cast doubt over the ability of cross-platform development tools to meet mobile’s most demanding business challenges. The decision also came as a shock to many developers because Airbnb was a big proponent of React Native and even contributed to its codebase. But, this isn’t a fair example to assess the power and flexibility of cross-platform apps or React Native, as Airbnb’s strategy was both unusual, and perhaps unwise for their situation.

In order for cross-platform apps to be performant and indistinguishable from traditional native apps (which they can be), they need to be developed from scratch utilizing a cross-platform API, and then only employ native components when absolutely necessary.

This is the approach Axway Appcelerator has taken with the Titanium SDK. With it, developers can share 90%+ of their code between mobile platforms, and use all the power and richness that Titanium offers through its cross-platform API.

The Titanium API allows developers to offer native user experience by creating elements from the API. Titanium then takes care of transposing this to the underlying mobile SDK. So, when we want to take a photo, or access a gallery, it’s the same code running for both iOS, Android and Windows – and Titanium takes care of everything on the native side.

The Titanium API is rich and covers a wide range of features across platforms. However, there are occasions when a developer needs access to the underlying native SDK, e.g. to access features of new beta SDKs or integrate a 3rd-party native SDK. In these situations, it’s possible to write native modules in Objective-C or Swift that can expose these features to the JavaScript API, or better still, write directly to the native SDK with JavaScript using Hyperloop.

With this approach of building cross-platform native apps from scratch (and having a single codebase), it is possible to create fast, feature-rich, cross-platform native apps that are indistinguishable from traditional “native” apps.

The Airbnb experience can be seen as a failure, but the experiment itself was a success, as it identified the issues they had with their implementation. As a result, they ultimately made a critical decision that, in this case, was the right one for their business.

Interestingly, many of the issues Airbnb (and other developers) experienced with React Native are expected to be addressed with the forthcoming rewrite, which was announced in June 2018. In that post, Facebook explained:

“We’re working on a large-scale rearchitecture of React Native to make the framework more flexible and integrate better with native infrastructure in hybrid JavaScript/native apps. With this project, we’ll apply what we’ve learned over the last 5 years and incrementally bring our architecture to a more modern one. We’re rewriting many of React Native’s internals, but most of the changes are under the hood: existing React Native apps will continue to work with few or no changes.”

To summarize, it’s clear that Facebook is investing heavily in React Native and that cross-platform is here to stay.

Likewise, Axway Appcelerator has big plans for cross-platform development with updates to the Titanium SDK coming this year to support iOS 12 and the latest Android operating systems. These updates, along with recent announcements of Angular and Vue.js, support developers to build cross-platform native apps using code and tools they already use for building web apps.

The future’s bright – and it’s cross-platform.