top | item 13863511

(no title)

fleshweasel | 9 years ago

I don't see why there can't be React-like libraries written and used in languages that compile to native. I'm not expecting to have JSX but I should be able to write component classes and implement their render methods, returning view trees written with some kind of object/array literal syntax.

To get as good of a development experience as React, it would require some work by the compiler and runtime people to basically let you do something like hot loading--Android has something like this now, and maybe Apple will get it too, though I'm not holding my breath.

I think it's a no-brainer for web development these days to do React because 1. you can opt out of it for parts of the page it's not going to work with for whatever reason and 2. the performance is pretty damn good compared to lots of alternatives, including writing all the UI state management logic yourself. However, I've not been convinced that the buy-in is worth it for native mobile development. Can someone who knows more tell me: is it fairly easy to do something like say "I can't/don't want to use React Native for this view controller--I'm going to implement it in code and use it and everything will just work."

discuss

order

jameside|9 years ago

Companies with large, existing apps that want to use React Native definitely share the desires written out in your last paragraph. Facebook has this need in their main app. And at React Conf today, Leland Richardson from Airbnb just gave a talk on using React Native in "brownfield" apps and seamlessly sharing a single navigation controller across React Native root views and UIViewControllers and Android Fragments. The navigation library that helps a lot with this is here: https://github.com/airbnb/native-navigation

marcbernstein|9 years ago

To your last point - yes, you can mix your view controllers (or Activity/Fragments on Android) between pure native and React Native implementations.

spicyj|9 years ago

ComponentKit is open source and a lot of the Facebook app is built on it.