Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

React Native is a cool project, but the deafening hype is slightly puzzling.

Creating and calling native UI components from JavaScript is nothing special in itself. It's obviously possible to do it from JS just as well as from any other language -- you just need to provide the API. There you have two choices: either a bridge that translates the native API directly, or a wrapper class hierarchy.

Examples of bridges include Xamarin's Mono that lets you build iOS user interfaces in C# code, and RubyMotion that lets you build Mac UIs in Ruby. Because these are bridges, the entire Cocoa API is exposed. The downside is that the bridge does nothing to smooth over platform differences: you can write in C# on all platforms, but you still have to learn Cocoa.

A prominent example of a wrapper API is Titanium Appcelerator that lets you build cross-platform mobile apps. Another good example is GTK+ for desktop apps: it's smart enough to leverage native Windows components where possible, but the GTK+ API is higher level than that of native Win32.

React Native is primarily in the latter category. Based on jordwalke's comment in another HN thread, they currently have cross-platform wrappers for View and Image:

https://news.ycombinator.com/item?id=8965044

But it appears you can also create platform-specific views, and for that they presumably have some kind of bridge. (It could also be that they provide manually written wrappers for platform-specific views, e.g. UIMapView becomes a <Map> and so on.)

In sum: React Native doesn't magically translate your JS+HTML app into a cross-platform native app. They're a long way off from having a full cross-platform API (unless your app is so simple that it can be described in terms of <View> and <Image>). And, like all wrapper APIs, there is a degree of impedance mismatch between the underlying platform implementation and the cross-platform interface on top.

There's a lot to like about React Native, though. The layout model and binding logic seems cool. The React team's accomplishments in the browser environment are impressive. With time, React Native could become for mobile what Qt is on the desktop -- and that's high praise in my books.



I think the hype is partly because many people (myself included) really like, even love React (and Flux). So being able to use it for native apps is great news for us.


Exactly this. I don't care about cross platform development. But I'd love to be able to develop UI's on Android using a similar paradigm I can do on the web with React. The main downside for me is that it's JS, not Java.


My day-to-day is very heavily skewed to app development rather than web development, but in my off-time I've been messing with React/flux. I have no issues with writing the objective-c, but the unidirectional style of React has been a real joy to work with and I've been thinking "How can I best imitate that while working natively?"

This could be the answer to that, and I wouldn't need to hack my own idioms together.


> but the deafening hype is slightly puzzling.

> With time, React Native could become for mobile what Qt is on the desktop -- and that's high praise in my books.

Sounds like maybe you're not so puzzled after all?

I'm not sure what you're hearing is hype. I think it's just excitement. Nobody is declaring this as The One True Way just yet, but a lot of people (you and I included, it seems) are cautiously optimistic that it could make mobile development a lot better.


The excitement I've witnessed has been more of the "One True Way", "completely unprecented", "cross-platform mobile solved for good" type.

People are talking about how they'll use React Native for new apps without any regard for whether it makes sense in the particular case or not. So I tried to calm down those expectations a bit.


Really? i find that odd considering they said it's not a cross platform tool really, you will still have to write platform specific apps. Just have a mostly one way to do it.


React is not necessarily novel, but the combination of techniques might be: React addresses so many issues/smells that were so common and unaddressed by other frameworks that its getting a lot of well deserved mindshare.


React Native doesn't presume to know how to build cross-platform apps. But we want to enable people to do that.

That results in two different classes of Native components:

- Cross-platform components that are nearly identical on each platform- Eg. <View>, <Text>, <Image>, <TextInput>, <ListView>. There will not be many more of these

- Platform-specific components- When there is not an identical API and feature-set, we provide bridged components which can take full advantage of the platform. There will be a lot of these, but we currently only have a handful.

The real power comes from React's component-driven declarative programming style. The asynchronous batched bridge is well designed, but it's nothing special.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: