Live data from Hacker News

With React Native it’s not all sugar and spice

blog.addjam.com

31–40 of 45 posts

Re: With React Native it’s not all sugar and spice

#32
post #20

Earlier quoted context omitted.

The case for React is strong in this respect, because Facebook has many lines of React committed to important production code. Your problems are also their problems... unlike Angular, which Google isn't relying on in production code nearly as much.

Yep, React is a good choice because FB is using it in production in their consumer facing apps. But React Native is not used that way by FB (yet?)

They are. In general it Facebook open sources something it means they use it.

Re: With React Native it’s not all sugar and spice

#33
post #30
post #28

HN community, how would I make my core model + business logic cross-platform? I want to re-use the model and its behavior (like some data evaluators) in my Web app, on Android and iOS without rewriting it every time from scratch. I'm fine with creating native code for the UI. but I'd like to share at least some code. What would you recommend?

If you use react native on mobile and react on the web the core model and business logic can easily be shared since it is just pure js. And you can use any of the languages that transpiles to js: TypeScript, Clojurescript etc.

What about performance and the "overhead" that React Native might introduce?

Re: With React Native it’s not all sugar and spice

#35
post #22
post #21

I'm working on an Android app. I use react-native solely for the UI which I update, redux-style, with a state-tree. The state and all it's transition and event-handling is done in Kotlin/Java. I've written a small helper that generates kotlin-Interfaces from the react/jsx-files and automatically connects everything. This way I have react's HotReload and the other benefits for UI-design and a proper typed language and…

Just to mention, if you enjoy Kotlin - you might want to try Anvil+Bansa. It is like React+Redux, but for Kotlin (or Java). Resulting APKs are much smaller than React Native and don't rely on jni code. http://anvil.site/ https://github.com/brianegan/bansa

Wow that stuff looks pretty cool. Thanks for sharing!

Re: With React Native it’s not all sugar and spice

#36
post #21

I'm working on an Android app. I use react-native solely for the UI which I update, redux-style, with a state-tree. The state and all it's transition and event-handling is done in Kotlin/Java. I've written a small helper that generates kotlin-Interfaces from the react/jsx-files and automatically connects everything. This way I have react's HotReload and the other benefits for UI-design and a proper typed language and…

Sounds like a great use case of React Native where RN is specifically used for what it is designed for: the UI layer. I've done apps with both approaches (all RN or UI-only RN), and I'd love to read or see more about your approach.

Re: With React Native it’s not all sugar and spice

#37
Many of the points made in the article boil down to React Native still being a relatively new framework, and the team and community behind it iterating very quickly.

Sure there will be growing pains starting out, but the benefits that are coming from this new direction are, in my opinion, worth all the effort. I've written several apps utilizing React Native now, and love the efficiency boost it gives me.

Re: With React Native it’s not all sugar and spice

#38
post #28

HN community, how would I make my core model + business logic cross-platform? I want to re-use the model and its behavior (like some data evaluators) in my Web app, on Android and iOS without rewriting it every time from scratch. I'm fine with creating native code for the UI. but I'd like to share at least some code. What would you recommend?

What I do is write the model and bussiness rules in Java, and I use J2ObjC[0] to export it for iOS. The configuration is not pain free, but once set up it has been extremelly reliable for me. I don't need to support web, but I hear GWT[1] works well for this. I don't see why JSweet[2] would not also work.

[0]http://j2objc.org/ [1]http://www.gwtproject.org/ [2]http://www.jsweet.org/

Re: With React Native it’s not all sugar and spice

#39
post #22
post #21

I'm working on an Android app. I use react-native solely for the UI which I update, redux-style, with a state-tree. The state and all it's transition and event-handling is done in Kotlin/Java. I've written a small helper that generates kotlin-Interfaces from the react/jsx-files and automatically connects everything. This way I have react's HotReload and the other benefits for UI-design and a proper typed language and…

Just to mention, if you enjoy Kotlin - you might want to try Anvil+Bansa. It is like React+Redux, but for Kotlin (or Java). Resulting APKs are much smaller than React Native and don't rely on jni code. http://anvil.site/ https://github.com/brianegan/bansa

I want to add anko, which might be more idiomatic for kotlin.

https://github.com/Kotlin/anko

Post reply on HN