Quick Look at React Native

reactNe-300x266

In early 2015, Facebook gave access to React Native, a framework for building native apps using JavaScript and React.  At first, it was only compatible with iOS, but last September, the Android support was added.  It was time for us, cross-platform developers, to take a look at it.

Screen-Shot-2016-02-02-at-9.01.32-AM

One thing that is very well done in React Native is how error reporting works.  It provides constructing and good information on the nature of the error: line number, stack trace, and possible fix or hint as to what might have gone wrong.  Since it’s primarily aimed at web developers, there’s a few things that are beneficial to native app development that you normally don’t get on iOS or Android: the almost immediate feedback you get on changes in the source code, exactly like you would on a web browser.  You also get to use the CSS Flexbox to design your views, which is a plus for new developers, especially if they never heard of the iOS Auto Layout.  Last thing, React Native is open-source, meaning that there’s a lot of components done by the community that could be used to ease up the development and even fill the gap for missing implementations.

As for the bad sides, React Native is an abstraction layer on top of the native platform, meaning that things could not work as expected (bugs in the layer for example).  There could also be a delay before a native functionality is available, as it was the case for the push notifications on iOS and for the yet-to-be-implemented Android M permissions.  Another downside is that if you want to design a custom control, you will have to do it in the native language of the platform, Java for Android and Objective-C for iOS.

Screen-Shot-2016-02-02-at-9.06.47-AM-copy

Being familiar with Xamarin, we cannot talk about React Native without talking about the similarities and differences between the two frameworks.  As it is the case with Xamarin (and more specifically Xamarin Forms), React Native is an abstraction layer, so the code you write for the views will, for the most part, be the same.  There’s a few discrepancies between the two platforms. For example on iOS, if you want a button you use the TouchableHighlight component, on Android you’ll have to use TouchableNativeFeedback.  They provide the same functionality, but their name is different which can be a bit confusing.  This is a known issue and will eventually be fixed.  Another difference is that, like mentioned above, you’ll have to use Java and Objective-C if you need to implement custom controls, as opposed to Xamarin where you can use C# for both platforms.

Finally, I believe React Native is a good solution for web developers, or fans of React, that want to start creating native mobile apps.  However there are a few known issues, which is understandable as the framework is still fairly new.  Nevertheless, this is an interesting project that we’ll definitely be keeping an eye on.

Recent Posts

Leave a Comment