Thoughts on React Native

At SVTi we always start off a new semester with something we call a SVTi-sprint. It’s simply a two week period when, instead of working in our regular teams with our everyday work and products, we form temporary teams working with different things that we ourselves have pitched beforehand. This is how it come that we spent the last two week building apps with React Native.

Why did we do this?

At SVTi we have a history of building a lot of web. And the majority of the web services we build are build with React. This means that the majority of the developers at SVTi know this framework pretty well by now. But in the last year we started to increase the building of native apps for mobile. We replaced old wrapper apps (apps that act as a this wrapper around our web pages) with native apps to give our users the best experience possible on these devices. This doesn’t mean that the web is less important, but we have to be able to produce great web and great native apps in parallel.

What we wanted to investigate during these two weeks was if it would be possible for us to take advantage of our already acquired knowledge of React and Redux to build native apps in a team only consisting of web developers.

First impression

Our first experience was how simple and smooth it was to get started. From a blank sheet to having a test app running in a simulator on our computers was only minutes away. Setting up the emulator for android was a little more work than getting started with ios development, but it was still really fast.

Code sharing and code reuse

To accomplish the investigation we decided to build TV-guide applications for both Android and iOS. Since we already had an almost finished TV-guide implemented in React and Redux for the web we could simply copy paste more or less all action creators, reducers and code handling requests to the API and put it straight into our React Native project. In this way we reused a lot of code already written for another platform.

Another nice thing was that the presentation code could be shared between Android and iOS but still feel native on both platforms. Sure, there are a few specific styling rules and connection to the native back button on Android, but the differences are negligible. Bear in mind that our application is quite simple and more complex interactions and design would certainly mean more platform specific code.

Productivity

For this kind of app with a relatively simple UI using built in components required directly from React Native and kind of primitive styling the development pace was experienced as fast. There are also good tools for live reload without overhead and compile time which makes it even smoother.

Ecosystem and documentation

The community around React Native seem to be fairly active and alive which makes it easy to find solutions on common problems. Since React Native is still young and not as stable as React some solutions get outdated quite quickly. This will probably stabilize in a near future.

Styling

As web developers we are used to write CSS which lets us style kind of anything we want. Since the overall feeling of React Native is very similar to regular React development for the web, it’s quite easy to forget that the code is actually not running in a browser and that the styling is not cascading. A custom styling is also experienced as far more complex than what we’re used to on the web.

Conclusion

One should keep in mind that this is a very simple app simply listing TV-channels and programs. We endeavoured to make the apps feel as native as possible on each platform but since the app is small with a limited amount of functionality there is also a limitation of interaction patterns that we managed to evaluate on this short time. Our conclusion however, is that React Native is definitely worth counting with for many kinds of applications. Probably not for games or other really demanding activities or complex custom designs, but for displaying data purposes we definitely believe React Native is sufficient enough.

The fact that is was extremely quick to get started, that we could reuse a lot of code from other platforms and share a majority of the presentational code between Android and iOS is also very appealing.

You should also keep in mind that the people in the team performing this evaluation were web developers with prior knowledge of React and Redux. But for someone lacking this pre-knowledge or for someone already familiar with native development React Native risks to be just another unnecessary layer or overhead.