Hacker News new | ask | show | jobs
by 2sk21 3421 days ago
I haven't been following React closely but this reminded me of a package called SWT that is used as the underpinning for Eclipse (https://www.eclipse.org/swt/). In the case of SWT, the underlying widgets are platform native but the orchestration is in Java. SWT was used to build a few desktop apps but mostly it seems to have been forgotten now. It left me skeptical of these kinds of thin UI layers.
1 comments

I'm not an expert, but I think that there is a different approach between React / React Native and SWT. SWT created layer of abstractions - when using their apis you were writing code once - and it was supposed to work the same way on all supported platforms. However React / React Native just use the same React paradigm to rendering controls, but the controls themselves are specific to the platforms. What you share is all the code that is not views, but views themselves are separate codes.
I've been working pretty extensively with RN these days.

Almost always, the code is the same (doesn't HAVE to be though but almost always is), and even the views are the same (barring some exceptions where Android and iOS have completely different design language requiring you to customize things at the code level using platform conditionals in the same source file).