At
React.js Conf 2015 Facebook announced React Native — a way to write native iOS and Android applications with JavaScript using the familiar React.js.
What is React Native
React Native is a way to build native apps in JavaScript using
React.js for user interface.
It doesn't use DOM for rendering, instead, it renders with native UI views. You write normal React components, but instead of using low-level DOM elements, you use native components provided by operating system, abstracted by React. For example, instead of
<div>
you use
<View>
, instead of
<img>
, you use
<Image>
, etc.
https://twitter.com/fisherwebdev/status/560504428613337088
https://twitter.com/reactjs/status/560864357341339648
How React Native works
React Native runs JavaScript engine in a separate background thread, which communicates with the native main thread using a batched async messaging protocol. There's a plugin for React that uses this protocol for communication.
To write apps, you use the familiar React.js API, everything down to event bubbling. This is where the nice slogan "Learn once, write everywhere" comes from.
For UI layout and styling there is a cross-platform Flexbox-like layout system and a subset of CSS.
https://twitter.com/andy_matuschak/status/560511204867575808
While developing, you can reload the app instantly in the simulator, like you do it in a browser.
https://twitter.com/chofter/status/560520740618108929
https://twitter.com/reactjs/status/560866143871574016
To write ReactNative apps you can use JSX or plain JavaScript, just like when writing React.js-based web apps. You can also use any other compile-to-JS languages, such as CoffeeScript or TypeScript.
Use in production
It turns out React Native is already used in production, even though it was just announced, in
Facebook's Groups application. Currently only the iOS app is build on it, not Android.
Available platforms
At this time React Native works on iOS and Android.
https://twitter.com/fbOpenSource/status/560506714382802945
Videos
Watch these videos from React.js Conf to learn more:
Introducing React Native
Tom Occhino's keynote from the first day of conference talks about the past and future of React.js, introducing React Native and discussing why developers at Facebook decided to create it:
[embed]https://www.youtube.com/watch?v=KVZ-P-ZI6W4[/embed]
A Deep Dive into React Native
Christopher Chedeau demonstrates the React Native developer experience and discusses its architecture:
[embed]https://www.youtube.com/watch?v=7rDsRXj9-cU[/embed]
Update: React Native is now open source and available from
https://facebook.github.io/react-native/.