visit our site
ionic vs react

Ionic vs. React Native, Building a Mobile App

In Android, Development, iOS, Mobile

by Sergey Korolev by August 25, 2017

Mobile is huge these days. But development and support of mobile apps is not a small thing. For both – iOS and Android – you need to have separate dedicated teams. There have been couple of attempts to build a unified framework to support both platforms. Examples are Phonegap and Ionic. Getting benefits from a single codebase you also pay the price – application performance.

When Facebook introduced React Native to the world a few years ago, many developers treated the open source project with a certain amount of scepticism. Some wondered why another client-side library was needed amongst so many others.

React Native was created to make it easier to build native apps. With the framework, view layer consists of React components, which are small fractions of code that describe how your app should look based on input data – that depends on the native platform the app is built on. Native apps usually perform better, certainly when it comes to rendering and animation than hybrid apps, which is one reason React Native was first created – to solve the problem of poor hybrid performance and the inefficient process to create native apps.

Ionic is a mobile app development framework, also designed to make mobile app development easier. So, React Native or Ionic? However, before we compare these two ways of building an app, we need to briefly refresh ourselves on the key terms: Hybrid and Native.

Hybrid vs. Native

Hybrid apps are not native. Hybrid apps are essentially websites embedded on a mobile platform through a WebView and styled to look like native. This is what Ionic provides out of the box. Hybrid app development can be achieved using HTML5, CSS or JavaScript and can execute the same code regardless of operating platform they are running on. With tools such as PhoneGap, hybrid apps can connect with native features of the phone/platform, including GPS, accelerometer, camera etc.

Native apps are – as the name suggests – native to the platform they operate within, created in the relevant coding language – Objective-C or Swift for iOS and Java or Kotlin for Android. Native apps can access all of the platform’s features without restrictions.

Hence, Facebook – Instagram’s parent company – and numerous other consumer-oriented tech and media brands, such as Airbnb, Vogue, Bloomberg and Netflix turning to React Native for native app development. Can Ionic match up to these credentials? Finally we moved to the main comparison here: React Native JS vs Ionic.

Comparing Ionic vs React Native

Creating Components

Ionic, as a hybrid development framework uses PhoneGap/Cordova to reproduce native components. Cross platform app development is more commonly undertaking using Cordova, ngCordova, Ionic, or a combination of two development frameworks.

On the other hand, React Native’s building blocks are reusable components compiled directly in the native platform. You get a consistent look and feel to every component. This component-based structure gives you all the speed, functionality and feel of a native app, and you can even apply – using plugins – React Native components to an existing apps code, instead of needing an entire overhaul.

Rendering

React Native functions best when writing apps in JavaScript. However, even when an app is written in another language, such as HTML and CSS, React will render features using native components. Rendering takes place in real-time – no need to recompile, rebuild, etc.; you see results straight away – instant, thanks to Live Reload. You also have the option to implement conditional rendering, depending on the state of your application.

Ionic also allows for immediate feedback, thanks to instant previews of your app on mobile devices. Any time you make a change, your app instantly refreshes.

Platform Adaptability

Hybrid apps run the same code and appear similar, irrespective of the platform. Ionic takes this into account and adjusts features to make cross-platform app development a smoother experience so that you can write an app once and it can run anywhere with minimal changes.

React does not want developers to ignore platform-specific logic and frameworks. Native app development requires more work, which is one reason why RN was created, to make it easier to build native apps. Most components have a platform-specific logical equivalent, so it shouldn’t take much work to adapt features from one platform to another.

Language Stack

Ionic is based on Angular, a JavaScript framework, which uses HTML templates for its views. Logic and views are separated when building apps in Ionic. Cross platform development is somewhat easier using Ionic since much of the basic underlying framework remains the same – although many ‘native’ developers would argue that is why native, not cross platform/hybrid apps are more finely tailored to specific platforms and devices. Essentially it is angular app with concepts from native world.

RN is also based on a JavaScript framework, using JavaScript code that resembles HTML, but essentially isn’t. It is known as JSX, which is something most developers are comfortable with, which results in a native app development using smooth UI components.

React only gets trickier when working with designers since JSX is not HTML and designers can not use CSS directly. However, this doesn’t limit CSS capabilities. Design styles resemble CSS, whilst underneath React Native turns the design inputs into platform-specific styles. You can write everything in JavaScript, with the only noticeable difference is that style names are written using camel casing, e.g. backgroundColor rather than background-color.

Ionic will leave some developers and designers working with them feel on familiar ground. Whereas, React might involve more work, especially when collaborating with other team members.

Testing on device

Nothing is more frustrating than waiting for feedback, or waiting to test whether an app you’ve been working on actually works in practice.

Both React and Ionic deliver a version of real-time testing. Ionic allows for instant previews on smartphones and browsers. It also instantly refreshes if you make any changes.

React also shows you the results of modifications as you make them. Native app development with instant results. Awesome!

Community

Working with any open source framework makes it worthwhile checking how healthy and supportive the community/ecosystem is around the technology. Remember, both Ionic and React Native have emerged from established ecosystems – Angular and React – so there are healthy, supportive online ecosystems.

Both are very active on GitHub, although at the time of writing, the difference is pretty noticeable: React Native vs Ionic – 50,100 vs 30,100. For both, multiple plugins already exist, and they support Android and iOS. Windows Universal Platform support is part of Ionic 2, but you need a plugin to access using React Native.

Which is better?

I wish we could give a definitive answer, but what tools you use during mobile app development is a matter of personal and team preference. It depends on you, your team, skills and user requirements. Both do different things and to be fair to React Native and Ionic; both do them well.

For those who prefer creating native apps, React is more effective, thanks to native rendering, making apps quicker and more responsive for the end-user.

Whereas, truly hybrid development platforms, such as Ionic, are more prone to speed and usability issues that frustrate end-users. UI is rarely up to the same standard as native apps or apps created using React Native, with it designed to make it easier to input third-party plugins using a native module without noticeably impacting loading speeds and using too much memory.

Saving time and money is usually one of the reasons companies choose to develop using hybrid development platforms, which can backfire when too much time is spent fixing problems – an issue that seems to be less prevalent amongst those who develop apps using React Native and the recently announced, Create React Native App – a collaboration product by Facebook and Expo.

We recommend testing both to see which you prefer before committing to developing an app in either framework.

Share
* Railsware is a premium software development consulting company, focused on delivering great web and mobile applications. Learn more about us.

Signup for our weekly newsletter

Want to get more of Railsware blog?

RSS Feed

We're always ready to help!

Contact us