Should you use React Native

I had an argument with a friend last week regarding React Native.

My argument was that React Native in my case gave little to no advantage vs just using Cordova.

Let me elaborate.

About 5 years ago I built a responsive web app. The app needed to run mainly on mobile.

When I started the project I used jQuery mobile.

The performance was horrible!

So I switched to Twitter Bootstrap with Angular.js. Horrible performance.

So I switched Angular.js with Knockout.js. Still horrible performance.

Finally, I decided to write the app with no css or Javascript framework. Just plain HTML css and Javascript using innerHTML (more on that later) and Mustache.js.

Guess what. The app ran incredibly fast.

Lately I started playing around with React Native, and I tried running that React Native app I’ve built on old devices. The app was extremely slow. So I ran my simple old html, css and javascript app and wow! what a difference!

I’m not saying that you can’t optimize React to run faster, but for what benefit? when I can actually write once and run everywhere with zero optimization.

And I’m not saying there is no use case for React.js or any other framework.

When you are developing in large teams you don’t have much of a choice. You need a Framework as a language between teams.

But if you are building a small to medium app, and you are a small team (up to 3 developers), and performance is important.

Drop all Javascript and css frameworks. Write your code in simple CSS (no transpilers) and Javascript ES5.

For DOM manipulation just use innerHTML. If you wish to understand why, here are some links

My general rule of thumb -

If it makes your life as a developer easier, then it makes your users life harder. and vice versa