Technology
Sep 04, 2015
React Native: Why You Should Care About Facebook’s New Open-Source Mobile Development Framework

Facebook recently announced a new mobile development methodology called React Native based on its popular React framework. React Native utilizes the power of ReactJS to control and manipulate native (read: iOS and Android) user interface elements and APIs using only JavaScript. The React Native codebase was open sourced in March 2015 and has been gaining traction in the web community ever since. After using React Native to write a native iOS app, I’m definitely a believer in the power and performance of the framework. Though there is certainly a learning curve to React’s “declarative” structure, it didn’t stop me from building a working app with live data on my phone in less than an hour. React Native significantly improved my iOS development experience and allowed me to use the language I use daily for building web applications: JavaScript. I think all mobile and web developers should give it a try, and here’s why:
How does React Native create a better mobile development experience?
Real Native Controls – No more HTML elements masquerading as iOS or Android components! At this point in time, web components still never feel as slick or polished as the newest iOS buttons or the latest Android animations. React Native distinguishes itself from Cordova/PhoneGap and other HTML-based mobile frameworks by letting you control actual native components via JavaScript. Download one of Facebook’s production apps at the bottom of this post to see for yourself what a difference this makes.
It’s React!
Virtual DOM & Speed – One of the biggest selling points of using the React framework on both web and native mobile is the concept of the Virtual DOM. This is one of React’s golden nuggets. Every time data within the application changes, React stores the resulting user interface (UI) hierarchy in a JavaScript object and diffs it with the real UI. This enables the application to effectively re-render the entire page on any change to the data model but only touch the specific interface components that need modification. The Virtual DOM concept allows React and React Native to make data binding and view re-rendering incredibly fast.
Componentized UI – React makes every piece of your application a “component.” In the web environment, the base level components React provides are wrappers for actual HTML elements (div, h1, span, etc.). With React Native, the base level components are native UI elements (like buttons, sliders, or navigation bars). To develop an application, you create reusable “composite” components that are self-contained collections of native controls for use in any part of the UI. Each component receives “props” from its parent component, and can maintain an internal “state.” That’s all there is to it! This means you can reuse a component from one system to another and immediately access all the functionality necessary to render that component.
Flexbox Styling – Styling native applications in React Native is as simple as writing CSS rules with the additional power of Flexbox. The Flexbox model allows for fluid, responsive interfaces that use as much or as little of the screen as needed to fill it up and keep it balanced. Learn more about React Native styling and Flexbox here.
Superb Error Communication – React lends itself well to very informative error messaging. React Native utilizes this system to show code line numbers and potential causes for errors full screen right in the iOS simulator. In my experience, this error communication speeds up the development experience significantly. React’s error messages inform you immediately about what went wrong and where to find the source of the error.

Instant Reload – This feature gets +1000 points for developer experience. Since React Native applications are written completely in JavaScript, reloading the app after making a change is as simple as Cmd + R in the iOS simulator. So long Stop/Build/Link/Deploy in Xcode. Once your application is running in the simulator, just refresh the page and the app is locked and loaded with your new code change.
