
React Native is now open source - peterhunt
https://github.com/facebook/react-native
======
zellyn
The first thing I do now on each Facebook open-source reveal, is to check the
PATENTS file for the toxic second paragraph, to see if they've changed it.
Sadly, no. I can't imagine being able to use this at any decent-sized company
with lawyers. :-( [https://github.com/facebook/react-
native/blob/master/PATENTS](https://github.com/facebook/react-
native/blob/master/PATENTS)

See for example the discussions at
[https://news.ycombinator.com/item?id=9111849](https://news.ycombinator.com/item?id=9111849)
(eg.
[https://news.ycombinator.com/item?id=9113515](https://news.ycombinator.com/item?id=9113515))

Full disclosure: I work at Google, where many are sad to not be able to use
recent Facebook code.

~~~
kendallpark
What would you suggest as a solution to this? What should Facebook do?

~~~
benologist
It's a near-certainty that any tech giant is going to have patent issues with
any other tech giant, not bundling the consequences of this with their open
source licenses would be a good start.

------
DigitalSea
Remember this day, because React Native is going to be a game changer (patent
clause stuff aside). Others like Phone Gap tried to make it so you could build
native apps using HTML/Javascript but they failed because they focused on
running said HTML/Javascript within a performance limited WebView and not the
other way around.

This weekend I am going to try and get a working application built using React
Native. Facebook are absolutely killing it in regards to their open source
contributions. The learn once, write anywhere paradigm is smart as opposed to
what others have done via their write once, deploy anywhere approach which
just doesn't work for web and native applications.

~~~
nwienert
I think there's a lot of proof that it does work, given there's 300,000 Ionic
apps, tons in production.

I downvoted you not because I don't agree that Native will be compelling but
because I hate to see all this hate that's come out against hybrid apps in
general that's even been propagated by React Native devs.

Webviews will get there. WKWebView is already a huge step forward. I think
Native is great, but it's not a clear winner in many cases. I even like "learn
once apply everywhere" (though it doesn't really go against the web in any
way), but I would say the mountain of hybrid apps out there actually disprove
that it "just doesn't work".

~~~
dustingetz
Webviews have been "getting there" for like 5 years now

~~~
nwienert
They've only existed for 8. We the rest of eternity. I get downvoted but I'm
just refuting your unbased claims with facts.

------
sheraz
Cool to see this. By my count we now have, in no particular order:

\- React Native from Facebook ([https://github.com/facebook/react-
native](https://github.com/facebook/react-native))

\- Appcelerator's Titanium and Alloy Frameworks
([http://appcelerator.com](http://appcelerator.com))

\- Telerik's Native Script
([http://telerik.com/nativescript](http://telerik.com/nativescript))

\- Xamarin ([http://xamarin.com](http://xamarin.com))

As I understand it, all three of these frameworks have a JS (or C#) runtime
that is compiled along with the app. This JS runtime is what drives the app
and uses the native features of each platform (iOS / Android).

I've been building on Appcelerator for the last 4 months on some basic apps,
and it works pretty well.

I look forward to trying out some toy apps on the other platforms.

~~~
emmanueloga_
Don't forget [http://robovm.com/](http://robovm.com/) (basically java for
ios).

~~~
badlogic
Thanks for remembering and mentioning us. We don't have as huge a marketing
budget as the other folks, so I'm going to shamelessly piggy back on your
comment here.

We also do Scala, Kotlin, Clojure etc. and we are OSS as well (we started out
as OSS). You can build unlimited apps without paying us a dime. You can also
compile the entire compiler plus Eclipse/Idea/Maven/Gradle integration
yourself so you aren't locked in.

We expose all iOS APIs and have a custom bridge besides JNI to make binding
and subclassing of Objective-C APIs and C APIs as seamless as JNA or p/invoke,
but without performance overhead. We use LLVM to compile JVM bytecode to
native code directly, so performance is excellent and on par with Objective-C.

At this point you can write apps for iOS and Android, using the native UI
APIs, and share business logic between them and your backend, if that's also
JVM based. I personally think that using native UI APIs is best. However, for
CRUD or enterprise apps you may not care about shininess, which is why our
next focus will be on a cross-platform UI toolkit for Android and iOS.

You do have to pay for debugging support, interface builder integration and
SLAs/hotfixing. We hope that's a fair way of supporting our OSS work.

Now I feel dirty...

~~~
jackweirdy
So if I have a common business logic library in Scala, could I build that into
both my app and my server side? Write once, run in 2 environments?

~~~
badlogic
Yes

------
spicyj
[http://facebook.github.io/react-native/](http://facebook.github.io/react-
native/) or [https://code.facebook.com/posts/1014532261909640/react-
nativ...](https://code.facebook.com/posts/1014532261909640/react-native-
bringing-modern-web-techniques-to-mobile/) would probably be a better link
here.

------
chubs
Hi, technical question from a long-time iOS developer here, i hope you can put
my concerns at ease:

How, when you're running JS on a different thread to the iOS main thread, do
you avoid race conditions? A simple example:

* Say a button's event handler pushes a new view controller onto the navigation stack, what's to stop the user from tapping the button twice very quickly before the JS thread gets a chance to service the first tap, eg it may be garbage collecting or busy elsewhere, and once it's free again it runs the handler twice and pushes two view controllers onto the navigation stack?

Looks great by the way, i'll certainly check it out.

------
freyr
Should someone learning iOS development stick to vanilla iOS while learning,
or would it be feasible to use React Native from the outset? I already have
some React experience, and I have some React-based web app that I'd like to
turn into native iOS app.

~~~
joslin01
If you're learning iOS development, stick to learning iOS development. A
framework, no matter how cool and neat it is, will not replace pure iOS
development for serious apps.

Also ask yourself a question, do you really think you can call yourself an iOS
developer when the only way you truly know how to create apps is with React?

~~~
arasmussen
> for serious apps

Like Facebook's Groups app and Ads Manager app, which both use React Native?

~~~
aikah
How much code is React Native and how much code is hand written Objective-C ?
can you answer that question ? "Use" doesn't mean 100% without a single line
of Objective-C written.

~~~
evv
Groups is a mix of native code and React Native, but Ads Manager is pure react
native. The app is completely written in Javascript.

------
renaudg
DevOps guy here, new to both JS and iOS, forgive the naive questions :

What proportion of iOS UI elements are available through React Native ? Is
there a 1:1 mapping somehow, but how are discrepancies between platforms
(Web/iOS/Android) handled then ?

Could a complex app's views realistically be built entirely using this or
would you have to resort to native UI elements in some cases ? How well would
they mix with React Native code ?

~~~
GVRV
Components are listed at [http://facebook.github.io/react-native/docs/getting-
started....](http://facebook.github.io/react-native/docs/getting-
started.html#content)

------
arasmussen
Want to get your hands dirty writing iOS apps with React Native? Start here:
[http://facebook.github.io/react-
native/docs/tutorial.html](http://facebook.github.io/react-
native/docs/tutorial.html)

------
dabeeeenster
Looks like it's iOS only right now? Can't see any mention of Android in the
docs?

~~~
Fishkins
"We are also working on an Android implementation which we will release later"

~~~
timepiece
It's taking them a long time since the announcement of the new framework at
React conf. They said they would release an Android compatible version soon
and still we're waiting for any updates beside the usual cliche.

~~~
uptown
It's been about a month since the world even knew React Native existed. You
consider that a long time?

~~~
timepiece
A month ago:

'We'll release an Android version later'

A month later:

'We'll release an Android version later'

You consider this progress at least in terms of PR & communications?

~~~
awad
HN entitlement never ceases to amaze me

------
lordbusiness
I'm very excited about this, but it's worth highlighting this from the FAQ:

Q. Can I submit my own React Native app to the App Store?

A. Not yet, but you will be able to soon. If you build something you want to
submit to the App Store, come talk to us ASAP.

~~~
spicyj
Oops, this was left over from our private beta. Removed now!

~~~
lordbusiness
Ok now I'm even more excited!

Thanks! :-D

------
CGamesPlay
React Native is the most promising cross-platform UI toolkit I've thus far
encountered. Congratulations to the team that built / launched it.

The reason I'm excited for it: Java promised write-once-run-anywhere, which
means you are always serving the least common denominator. React Native
promises learn-once-write-anywhere, which means a single team of engineers can
realistically build high-quality apps using the target platform's UI
paradigms.

Really exciting stuff!

~~~
badlogic
WORA is pretty much a pipe dream, to different are the platforms and UI
toolkits. One of the reasons why we heavily focus on enabling the same
language(s) on multiple platforms while using the native UI toolkits with
RoboVM.

Funnily enough it's a different matter for games, see Unity, UE4, libGDX,
Cocos2D-x etc.

~~~
matulkum
I think many people dismiss this recommendation right away nowadays, but here
it goes:

Adobe Air comes pretty close to "WORA". For 2D games it goes almost without
saying, but throw in the excellent Starling + Feathers framework and it is
great for Apps too. A drawback is of course that you do not have native UI,
but if you can get passed that it works really really well.

I evaluate cross platform technologies quite regularly and my opinion still is
that Adobe Air is the best (just make sure you stay away from Flex ;) For
everyone who gave up on Adobe Air some time ago I highly recommend to take
another look. The Eco system did not stop to evolve at all and it provides a
really good development environment.

~~~
badlogic
I can see the appeal of Adobe Air and its ecosystem. I guess on mobile the
only problem is binding to system services & ad providers. IIRC most of that
is already covered by 3rd parties, but it's a bit involved to do it yourself.

Funny you mention Flex, still gives me the shivers, still used by a lot of
enterprises around here. Pretty much on par with applets in terms of badness.

~~~
matulkum
Hey.. actually I also just got the task to integrate an Ad provider in out
game and made a little research. As far as I can see almost all big companies
are providing Adobe Air SDKs for integration. For Example:

[https://www.adjust.com/](https://www.adjust.com/)
[http://www.mobileapptracking.com/](http://www.mobileapptracking.com/)
[http://www.appsflyer.com/](http://www.appsflyer.com/)
[https://www.kochava.com/](https://www.kochava.com/)
[http://www.fiksu.com/](http://www.fiksu.com/)

Alright.. I am done with promoting now, I think ;)

------
fredliu
Great news! One question: since FB just announced React+Parse, I wonder how's
support for Parse in React Native? Or put it a better way, if I want to write
an multi-platform app based on Parse, should I consider using React Native? or
it's still better to developer separate apps for each platform to get the best
of Parse (especially for features like push notification)?

~~~
vjeux
You can `npm install parse` and run it as usual within a React Native app

~~~
fredliu
Great! I guess it wouldn't be a problem for common operations like data
creation and fetching, since underneath it's all implemented through REST
APIs. But what about push notification? Parse's JS library doesn't support it,
but its iOS library does support it through platform's push notification
mechanism. Does this mean using Parse in React Native, I can't get Push
Notification to work on iOS? or I still have to write native iOS apps to get
push?

~~~
evv
We built the F8 app with parse, including push notifications

Take a look here: [http://facebook.github.io/react-
native/docs/pushnotification...](http://facebook.github.io/react-
native/docs/pushnotificationios.html)

~~~
fredliu
Super! Hopefully React Native + Parse will become my "one ring to rule them
all" for app development.

------
Uroboric
I'm interested in this primarily because I don't find it appealing to invest
in (basically non-transferable) iOS platform skills. I want to build native
mobile UIs for my projects, but not with a dead-end language and tools.

~~~
arcosdev
Precisely, every time I go to learn Objective-C/Swift and iOS dev, I feel like
I am totally wasting my time.

------
brokencode
Does anyone else really want to see a version of Elm that compiles to React
Native? Since Javascript is the de facto intermediate language of the 21st
century, frameworks like React Native open a lot of doors.

~~~
spion
If you can't wait for it, you could use PureScript and fork Thermite [1] to
add react-native support :)

[1] [https://github.com/paf31/purescript-
thermite/](https://github.com/paf31/purescript-thermite/)

------
jakejake
Incredible on iOS. Android support... coming soon!

This seems to be the case with a lot of cross-platform development kits. One
or the other of the platforms is a second-class citizen.

It seems that all of us are salivating at the idea of having true cross-
platform tools that actually work really well on all environments so I will
keep my fingers crossed that Facebook can pull it off.

~~~
augustl
FWIW it won't be cross platform, it will be a separate implementation for
Android. The goal is the model, not the write once pipe dream.

~~~
felipesabino
True, but if you can write once at least the business logic, is is already a
win

~~~
robertfw
I am also wondering how much scope there is for writing generic interfaces
that delegate to UI specific components as needed. I haven't done any native
mobile development before so I'm not sure how possible this will end up being,
but seems plausible.

------
mwcampbell
Is React Native for iOS able to take advantage of JavaScriptCore's JIT
compiler on any version of iOS? Or can it only use the interpreter?

If the latter, I wonder if the React Native developers have considered using
Duktape rather than JavaScriptCore. Duktape might be better for memory usage,
since it uses reference counting, with mark-and-sweep GC only being necessary
to break cycles.

~~~
evv
Duktape looks quite nice!

Because we built React Native around an asynchronous batched bridge, we can
plug it into any JS execution environment. For now we plug it into JSC, which
is available on iOS 7 and 8. We also use websockets to execute the JS in
chrome so we can utilize the debugger.

Without much difficulty, we can make the bridge work over a WebView (if we
want to support older iOS versions), or Duktape.

------
T-A
Cross-platform, as long as it's iOS? ;)

------
aravan
But why React Native? Reactjs for web makes sense as browsers struggle with
DOM manipulation.

Native apps rendering capacity is sub-micro seconds. Hoping for Appcelerator's
dreaming Hyperloop that give us native JS capabilities.

I still plan to use ReactJs (web) within web-view.

~~~
tootie
Fills the same niche as Cordova/PhoneGap or Xamarin. It's kinda the best of
both. Intuitive dev process for web developers not needing to learn new
paradigms. Fully native compilation for better performance than WebViews.

~~~
badlogic
Are you sure they compile to native? IIUC they use JavaScriptCore on iOS,
which currently doesn't JIT. Probably good enough to drive UI and you can
implement performance hungry stuff in native code.

~~~
tootie
Not sure, but it's native UI at least. The demos they showed prior to release
were far more responsive than any WebView based solution.

------
garindra
A little typo on the code example on the ListView docs page
([https://facebook.github.io/react-
native/docs/listview.html#c...](https://facebook.github.io/react-
native/docs/listview.html#content)):

    
    
        new ListViewDataSource
    

should have been:

    
    
        new ListView.DataSource

------
HaloZero
I'm curious, can somebody talk about the differences between using React
Native vs ComponentsKit?

It seems ComponentsKit is a very specific to iOS as opposed to React.

[https://github.com/facebook/componentkit](https://github.com/facebook/componentkit)

~~~
bkurtz13
With React Native you write your apps in JavaScript, in a React.js style.

My understanding is that ComponentsKit has you write your iOS apps with
ObjC/Swift or whatever, but it gives you a way of structuring your apps that
is similar to React.js

~~~
solarexplorer
ComponentsKit is Objective-C++ only (no Swift).

~~~
clay_to_n
I think they've said they are working on a Swift port (at the end of that F8
video talking about it).

~~~
solarexplorer
Yes. I think it will be worth the time to rethink it for Swift, because Swift
is much better suited for this style of programming than Objective-C++.

------
ransom1538
Please see this image:

[http://facebook.github.io/react-
native/img/chrome_breakpoint...](http://facebook.github.io/react-
native/img/chrome_breakpoint.png)

I am really confused. Why is this easier - this looks extremely buggy and
complex?

~~~
woah
Looks like the chrome debugger. I just built a react native app, and for the
basic Ajax + list view, it is far easier than the usual drag'n'drop/imperative
iOS we are used to.

------
findjashua
well, there goes my weekend

------
kendallpark
Hallelujah!

I've been checking my Twitter obsessively today and yesterday for this.

~~~
tav
I'vs been obsessively checking too, but for React Relay :(

~~~
garindra
It's the server-side GraphQL for me :(

~~~
Rygu
Someone wrote a GraphQL query parser.
[https://github.com/madjam002/graphqlite](https://github.com/madjam002/graphqlite)
There aren't any GraphQL servers yet though. Pretty hard to write too in a
generic useful-for-all manner.

------
mempko
How does this compare to Qt project QtQuick, which supports far more platforms
then react native. Both use javascript and both are reactive programming
systems...

~~~
bananaoomarang
It's personal preference, but I prefer React ATM.

------
lucidrains
I know what I'm doing this weekend!

~~~
cozuya
FlappyReact?

~~~
masterj
2048 - React

~~~
evv
I think we beat you to it:

[https://github.com/facebook/react-
native/tree/master/Example...](https://github.com/facebook/react-
native/tree/master/Examples/2048)

~~~
masterj
I'm the one who wrote that ;) Didn't know it made it into the repo!

~~~
evv
Oh! We need an internal integration with HN so we can identify each-other on
here :-D

------
PSeitz
Can someone point me to the added value by react native? Why so much hype? I
just don't see it.

------
grego
After figuring out how to deploy to device (see AppDelegate.m), I tested
accessibility and it seems there is virtually none. At least in the Movies
example app, VoiceOver reads practically nothing.

How would one go about making the Movies sample accessible, or is that even
possible?

------
shaohua
All the SF people, want to meet up casually on this new shinning toy?

[http://www.meetup.com/SF-React-Native-Meetup/](http://www.meetup.com/SF-
React-Native-Meetup/)

------
thoman23
I am excited for the possibility of "Scala Everywhere".

Scala -> Scala.JS -> React Javascript -> Native code

I'll have to try this out on a small project and write about it.

------
itsbits
I am seeing something like this in Native code

var { AppRegistry, Image, ListView, StyleSheet, Text, View, } = React;

is this ES6 feature?

~~~
billybolero
Yes, that's an ES2015 (formerly known as ES6) feature called destructuring.
It's just one of the great features of ES2015. You can use ES6 today by
transpiling to ES5 with [https://babeljs.io](https://babeljs.io)

------
blazespin
Isn't this just appcelerator? Except appcelerator has android support and has
been around for longer.

------
nashashmi
This does not make sense to me: var { ScrollView, TouchableHighlight, Text } =
React;

It gives an error in Console.

~~~
funksta
This is destructuring (a new feature in ES6, the upcoming version of
JavaScript). There's a great in-depth read on how it works here:
[http://www.2ality.com/2015/01/es6-destructuring.html](http://www.2ality.com/2015/01/es6-destructuring.html)

------
amelius
Does it support android as well?

~~~
edoceo
No support for Android (yet?)

~~~
amelius
Is it possible to at least run the app in a webview then?

------
aikah
So is the UI 100% core Ios or does some widgets live in a Webview ie html
widgets ?

~~~
jonhester
No webview.

------
itsbits
Any one did code through of this? Would love to know some highlights

------
itsbits
How can we manage the Asynchronous parts like Ajax for example?..

------
levosmetalo
Now waiting for the React-Native for the Android :)

------
cozuya
Is this node/ES5 only or can we use io?

~~~
spicyj
Your apps run in JavaScriptCore (like Mobile Safari) on device, but our
packager includes a transpiler set up so that you can use most ES6 features
already.

------
thedangler
Will It support OS X Applications as well?

~~~
nacs
They've stated in the past that they're focusing on iOS then Android first but
that the system could be used on other platforms like Windows/Mac/Linux.

------
auston
Where is @grellas when you need him most?

------
revskill
How can i use Sqlite with react native?

~~~
evv
There is currently no native module for SQLite, but you can build one if you
want. :-D

[http://facebook.github.io/react-
native/docs/nativemodulesios...](http://facebook.github.io/react-
native/docs/nativemodulesios.html)

We use a key-value store for most of our client-side persistence:

[http://facebook.github.io/react-
native/docs/asyncstorage.htm...](http://facebook.github.io/react-
native/docs/asyncstorage.html)

~~~
almost
I've built a basic wrapper for SQLite for React Native:
[https://github.com/almost/react-native-
sqlite](https://github.com/almost/react-native-sqlite)

------
itsbits
can we use Babel over the top of it?

~~~
aikah
Is babel compatible with JSX ?

~~~
robertfw
yup, plastered right on their front page :)

[https://babeljs.io/](https://babeljs.io/)

~~~
aikah
Is JSX compatible with Typescript ?

~~~
spion
There is a fork that is: [https://github.com/fdecampredon/jsx-
typescript](https://github.com/fdecampredon/jsx-typescript)

------
curiously
omg...I'm so excited

still wish there was a way to develop for iOS on windows platform but I guess
I will have to purchase a mac now if I want to build mobile apps

~~~
oyvindkinsey
With RN, you really only need XCode to build the initial app and the final
build for submission - everything in between can be done on any platform that
can run the packager with a phone for actual testing. So if you have a friend
with a mac, you're good!

------
M8
_"...Native ... based on JavaScript..."_ \- facepalm.

