title: Why React Native Matters
url: https://joshaber.github.io/2015/01/30/why-react-native-matters/
hash_url: 570dc238ef55025f007301089653340b

<p>A couple days ago Facebook announced React Native, a version of <a href="http://facebook.github.io/react/">React</a> that outputs native views instead of a DOM.</p>

<p>This is fantastic news for us native developers. But before we get to why, let’s dispell a couple concerns.</p>

<h3 id="react-native-isnt-just-another-titanium-or-phonegap">React Native isn’t just another Titanium or PhoneGap.</h3>

<p>React Native is <strong>not</strong> a write-once-run-everywhere solution. The phrase Facebook has used so far is “learn-once-write-everywhere.” They’re interested in sharing the paradigm of React across platforms, not the code necessarily.</p>

<h3 id="javascript-is-an-implementation-detail">JavaScript is an implementation detail.</h3>

<p>Don’t get distracted by the use of JavaScript. JavaScript is just a language. There are plenty of <a href="http://www.purescript.org">other</a>, <a href="http://www.typescriptlang.org">better</a> languages that can be compiled to JavaScript.</p>

<p>The important thing about React Native is the <em>idea</em> behind it.</p>

<h3 id="react-lets-us-write-our-uis-as-a-pure-function-of-their-state">React lets us write our UIs as a pure function of their state.</h3>

<p>This is a big, important idea.</p>

<p>Right now we write UIs by poking at them, manually mutating their properties when something changes, adding and removing views, etc. This is fragile and error-prone. <a href="https://github.com/ReactiveCocoa/ReactiveCocoa">Some tools</a> exist to lessen the pain, but they can only go so far. UIs are big, messy, mutable, stateful bags of sadness.</p>

<p>React let us describe our entire UI for a given state, and then it does the hard work of figuring out what needs to change. It abstracts all the fragile, error-prone code out away from us. We describe what we want, React figures out how to accomplish it.</p>

<p>UIs become composable, immutable, stateless value types. React Native is fantastic news.</p>
