5 Reasons Why You Should Use React Native

tldr; I’m a React “fanboy”.

A few years ago, I came across two brand new javascript frameworks in Meteor and React. At first glance after comparing the two I did not really understand what was so special about React, meanwhile I would’ve bet the house that Meteor would be the next big javascript framework. It gave users the total package from frontend framework to backend database all with one line of code in the command line which no other framework had really accomplished.

After starting building my side projects in Meteor to get used to using the framework I quickly realized that it was somewhat of a black box of code and some things like authentication just magically started working. While every non-coder may think what we do is magic sometimes, every programmer knows that if it can magically start working out of no where, it can also start magically breaking without the knowledge of knowing how to fix it.

Bring in React… I’ll be honest, I still didn’t get all of the fuss about it even after I built out the initial example of the React website. It just seemed like a confusing version of javascript to me. But then I saw that the React team was working on framework called React Native that would work on both iOS & Android (despite the Android version coming out much later)…GAMECHANGER. Neither the React Native code for iOS or Android was available yet but just the fact that a large team like the Facebook Dev group was working on a solution like this got me excited enough to start all my new web projects in React. I figured taking this approach I could be prepared when React Native was finally released in March of 2015.

Fast forward more than 2 1/2 years…I’m a React fanboy.

BUT WHY?

1. Learn Once, Write Everywhere

In the past when other javascript frameworks (Meteor, Ionic etc.) tried to build tools to compete with native development they simply used Cordova to make javascript look like native Swift or Java code when in reality they were super wonky. They touted the phrase “Write Once, Use Everywhere”. Yes that sounds amazing but you cannot just treat two inherently different platforms in iOS & Android as one and expect it to work perfectly. That is why the React team took a new approach and wrote out there own natively written modules that could be directly communicated with in React & JSX. It also gives the coder the ability to write native code alongside React if any further native functionality is need which is another huge plus in code flexibility.

2. Rapid Prototyping

One Word: Live Reload errr two words. Usually it is Javascript trying to catch up to both Swift & Java but those two need to take a lesson from Javascripts’ book and look into some type of live reloading feature for development because dam it makes things so much faster and smoother during development. Yes I know both need to recompile every time to see the new changes but after learning React Native and then working in native Swift and Java, it gets super frustrating and takes much longer to see any new changes. There is much more to React Native that makes for great rapid prototyping like overall structure with reusable components, the ability to use NPM and the vast majority of pre-existing web modules for mobile and much more. I just mention Live Reload first because when switching between React Native and Swift and/or Java…or Objective-C, it is the first thing you notice in speed of development.

3. iOS, Android & Web

This one is pretty self-explanatory and points back to reason #1, “Learn Once, Write Everywhere”. While you certainly won’t just be copying the same code you wrote from the web application and pasting it into the iOS and Android version expecting it to work, there are a lot of reusable modules between platforms. Some projects I was able to use up to 80% of my iOS code for my Android project and it still worked great. There are still some main components ie. Navigator vs. NavigatorIOS which are completely different but a majority are used on both platforms.

4. The Community

I initially did not put these in any particular order but this one might be the most important to Reacts current and long-term success in the rapidly changing world of javascript frameworks. Let’s look at some Github stats here:

React-

Stars- 80,420

Forks- 15,244

Commits- 9,349

Contributors- 1,125

Last Update- 2 hours ago..

React Native-

Stars- 55.552

Forks- 12,957

Commits- 12,159

Contributors- 1,525

Last Update- again 2 hours ago..

These are two of the most updated repos on all of Github and it shows they are constantly trying to make the frameworks better and future proof…as much as a javascript framework can be.

5) It’s Fun

Calling all programmers, whether you need a Web App, Desktop App, iPhone or Android App then give React a shot, you won’t regret it since once you get the overall gist of the code it’s just fun to work with!

Conclusion

Check out the video below for a more in-depth overview for the How To Build Tinder w/ Expo Course.

React Native vs. Expo

Want To Learn How To Turn Your Ideas Into Code?


Written by Tim Moreton who lives and works
in Philadelphia building useful things.