React Native: A Shared Codebase for Android and iOS

Developers
Artikel | React Native: A Shared Codebase for Android and iOS

At Itiden, we have been working with React Native for several years to build apps for both our own use and for our clients. Being able to use roughly the same app codebase for iOS as for Android saves both development time and maintenance costs.

In this article, we take a closer look at what React Native actually is, how it works, and the advantages and disadvantages of this framework.

What is React Native?

React Native is an open source framework developed by Meta and was launched back in 2015. The background was to reduce the workload involved in maintaining two separate codebases for iOS and Android when the functionality should be the same anyway.

Typically, apps are written in JavaScript or TypeScript using the React library. So that it works with a shared codebase for two seemingly entirely separate languages like Swift (iOS) and Kotlin (Android), React can use the operating system's own components. This results in the app being a true native app, where both performance and functionality make it impossible to distinguish from apps written in the respective languages. In addition to React using the device's native UI components, most of the device's built-in functions such as GPS, file system, notification system, camera, and so on, can be used without having to build custom solutions.

This has contributed to React Native today being a relatively common way to build apps and is used in several of the most widely used mobile apps today, such as Facebook, Instagram, Visual Studio Code Web Client, Discord, and Shopify.

Advantages of React Native

We have already mentioned a couple of the benefits of using React Native, but there is more to gain. Below we list some of the biggest advantages.

  • A shared codebase makes development faster and maintenance less intensive.

  • Compared to many other cross-platform solutions, the performance is nearly identical to a true native app, as the operating system's own UI components are used.

  • A wide range of components means that the chances of finding a pre-built feature are high, so you do not need to develop functions from scratch.

  • Thanks to an enormous community, it is easy to find information and solutions, and the platform is well-maintained and developed rapidly, not least by Meta itself.

  • In addition to Android and iOS apps, you can also build applications for the web, Apple TV, Mac OS, and Windows with React Native.

The Alternatives

Although React Native covers virtually all conceivable areas of app development, there are alternatives that may be worth evaluating if you face the challenge of building an app.

Native (Swift/Kotlin)

There are occasions when it may be worthwhile to develop entirely "native" for each operating system. This could involve getting direct access to new OS features without waiting for React Native to add support. Although the performance you get with React Native is extremely similar to that of an app written in Swift or Kotlin, there are examples where using the system's native language is beneficial. Advanced 3D games are an example, where every fraction of performance counts.

Apple Music built in Swift

Flutter

Flutter is a cross-platform alternative to React Native developed by Google, with the same goal and purpose – a shared codebase for multiple platforms. While React Native typically uses TypeScript, JavaScript, or React, Flutter instead uses its own language, Dart, and a declarative UI framework that is rendered in its own engine, Skia.

The advantage of React Native compared to Flutter is the similarities with JS/React that are typically also used for web development, which makes the learning curve shorter for a web developer.

Superlist is an example of an app built in Flutter.

Why We Choose React Native for Mobile App Development

Although there are advantages to both Native and Flutter, React Native's benefits outweigh the alternatives for us. Being able to get up and running quickly on a project and being able to rely on the operating system's own functions for two completely different operating systems has simplified development for us.

The fact that the performance in the vast majority of cases is fully comparable to the alternatives, combined with the similarity to web development, has made it easy for us to scale development teams in projects as needed and at the same time deliver apps that are both stable and secure.

🔗 Links to Apps We Built with React Native

Read More

More articles