JS runs natively on mobile. Now what?

Some years ago, talking about JS and phones was synonymous of web wrappers.

Have you ever heard about Phonegap, Ionic, Sencha… ? All them wrap a browser inside an app. We could use our web development skills, at the cost of the performance. What a bad deal.

But times change. Since last year, new contenders take a chance in this “hybrid apps” world. The ace up sleeve? No web wrappers. We’re talking real native here.

Nativescript and React Native are the biggest options here. Both have important companies behind them, and great features to track the attention.

Main purpose of this article is not explaining how they work tho.

I’ll try to explain the main differences between them, and help you choose the best suited for your needs.

React Native

Learn once, write anywhere

Being the son of one of the biggest social networks has its privileges.

As a creation of Facebook, it took the approach of the React framework, and exchange the DOM to wrap native components.

Want to check a production-ready example? Take a look to Facebook Ads app. Both android and iOS.

Knowing React give you an advantage to start right now. If not, it won’t take you too much to understand how it works.

You can find tutorials everywhere. And, big plus here, the community is huge. There are libraries, extensions, products, its own IDE (Nuclide), and other software around it.

The only down side is when you need a native library, and no one has wrapped to be used in RN yet.

In this case, you will need to learn a little about Java or Objective-C to expose the api of the component into JS. It’s not as hard as it sounds, but it take some time to get use to.

Working with React Native is something I enjoy. As a React learner too, its great to find help in Reddit and the official chat site, for example.

Just as a reminder: React Native doesn’t use HTML. Styles are created like objects. This is all about JS.

Nativescript

Competition is always good, right?

Telerik is the big company behind it. As React Native, JS is the language you will use to create your apps.

But, in this case, you can choose Angular to create your components. And this is not just about JS either.

Views are created using XML. CSS works as the web version, no big changes here.

Big deal here is how they handle the libraries.

Remember that you need to create an interface to let React Native use some libraries? Nativescript let you access them directly from JS. No wrappers.

Great thing is, if someone releases a new api, you don’t need to wait for the change in the interface to access it. Nativescript let you use it right away.

Downsides? Of course it has! The community around is not as big as React Native. It’s kind of hard to find third party libraries.

And this XML thing is not the cup of tea of some developers (including myself).

Conclusion

So there you go. I still switch between them from time to time, cause I find some things are easier to do with one than the other.

The power to access the apis without creating native code around them is a deal breaker for me. And using Angular 2 is a sweet addition to consider.

But the big community, libraries and support are things that makes React Native special.

And how you build the entire app using just JS is just great.

I still feel that is pretty early to choose a winner. But hope this help you to choose one of them to start your first app.

Even when both achieved the same goal, the road is what makes them interesting.

See you in the comments!

Show your support

Clapping shows how much you appreciated Carlos López’s story.