Show HN: Target almost all platforms at once with react native
github.com
github.com
I get that one of the advantages of React is that you have so much freedom to configure your app or use the exact modules you want. But trying to do that right now has been a downright nightmare. I've spent most of my time resolving dependencies issues or navigating open Github issues trying to get some basic things to work.
The underlying conceptual model is extremely solid, though, so I'm figuring it is well worth it to put up with some of this pain right now as a sort of investment.
EDIT: If you're interested in React Native but don't necessarily want to go through the (very short) motions of getting set up with a local environment, give the web player[1] a shot or take a moment to play with the interactive documentation[2].
[1]: http://dabbott.github.io/react-native-web-player/
[2]: https://facebook.github.io/react-native/docs/flexbox.html
Even if you use one of these component libraries though you will just be deferring learning the basics of React Native layout and decorative styles until later on. It's an unavoidable tax you will have to pay one way or another. Thankfully it's not too hard- the documentation is explicit about what style properties apply to which components (example: `View`[4]) and the `StyleSheet`[5] helper will bark at you if you use invalid styles.
[2]: https://github.com/xotahal/react-native-material-ui
[3]: https://github.com/jondot/awesome-react-native
[4]: https://facebook.github.io/react-native/docs/view.html#style
[5]: https://facebook.github.io/react-native/docs/stylesheet.html
There really needs to be a library which bridges the native Android (and iOS) modules and React Native, in order for React Native to be more useful and used more.
Development seems slow - they haven't managed to fix their "single-threaded JavaScript" performance woes which has been plaguing them for years, their provided navigators are horrible, they have no "native" default components (no native radio group controls, combo boxes, etc), no built-in push notification support, and their animations and performance are _slow_.
For relatively simple apps without a focus on native "feel", it is fine and very fast to develop with.
*iOS excepted.
The TODO list includes
* support for macOS(react-native-macOS) * support for Windows (react-native-windows) * improve webpack config and add media queries for web * Add example projects for each branch
React-as-paradigm is more powerful than any one particularly implementation; it's a wonderful way to describe user interfaces, and using cross-platform primitives is a perfect way to abstract design systems.
~= full disclosure - coworker is working on https://github.com/lelandrichardson/react-primitives, which I've used a bunch
React.js is the view layer of a web app/page. ReactNative is a whole framework for making an app (that you could call back to a database, do some logic on the data and display it to the user.)
Is that right?
Without having more experience with Titanium, its hard for me to say if you can use ReactNative along side it, but my gut says they probably have a different way of doing things.
React Native is a system of bindings of native APIs to Javascript. This includes bindings which allow you to use native UI elements just like you would use divs, inputs etc. for React on the web, but it also includes bindings for common mobile OS APIs like geolocation, camera, maps, etc.
I was thinking yesterday about fork it and add more platforms for my own use, now I try your project first and create a thin clojurescript layer over it, tks :)
The nice thing is, this is how all platform targets work. It's the platform extension's responsibility to map React Native to their platform. In the case of layout mapping, this typically involves mapping to the `Yoga`[1] layout engine on that platform.
I'm looking for a cross platform (>= iOS+Android) mobile solution, so I can write a web app once, and deploy it easily as a mobile app on multiple platforms. The app will be very simple, almost proof-of-concept-like; I basically just need something not ugly that can connect to the RESTful app backend.
I've been Googling for the past couple of weeks, and so far https://coronalabs.com/ and https://dropsource.com/ look interesting, but I would love to hear from someone with experience.
Coronalabs is all about graphics and therefore well suited for games. They do offer some very basic widgets, which are not native (which is ok, but you probably have to create some yourself, for example they no lists if I remember correctly).
Dropsource focuses on offering the same dev experience for both iOS and Android. But you still have to build each platform separately. Its a bit like React Native without the cross-platform option.
> With React Native, you don't build a “mobile web app”, an “HTML5 app”, or a “hybrid app”. You build a real mobile app that's indistinguishable from an app built using Objective-C or Java. React Native uses the same fundamental UI building blocks as regular iOS and Android apps. You just put those building blocks together using JavaScript and React.
You can use native code, the JS components render to native things -- there's a lot to it, and I'm sure I can't explain it properly, better to just check out their guide.
Also, React Native was not built to be used on all the platforms -- I remember when RN for android (I believe IOS support was out first?), people started asking (of course) whether they could write code that would run on both platforms and the tools team said something to the effect of "the code will look similar, but will not be the same".
Of course, that doesn't stop someone from writing components that compile to other components or something or writing some sort of cross-platform group of components on top.
Honestly I think companies that opt for a browser-based non-native UI do those for reasons that won't change just due to RN existing. Once developers get comfortable with RN, and start offering themselves as "we do native apps in half the time, give your users better-than-mobile-browser-site performance", I think the companies that were content to jam a webpage into an app will start improving.
Also note this article with a pretty good criticism of React (I find those are lacking these days): https://bitquabit.com/post/the-more-things-change/
tldr; Turns out react is a little bit similar to a thing called COM, but maybe we're better at this pattern now and things won't become spaghetti
I actually wrote an app in native swift and then re wrote it in React native. I don't have any benchmarks but using it I havn't noticed it's any slower than the native one. And I think it looks better! Because, for me, it's easier and quicker to create things in JS than Swift.
This is the app btw. 100% React native! https://itunes.apple.com/us/app/rekindlr/id1072608462?mt=8
No. If you want native look-and-feel, you'll need to download and install third party libraries, e.g. for Material Design. However, those third party libraries are implemented in 100% JavaScript and do not utilise the native Android components (rather just rebasing off MDL [1]), which will just end up making your app "feel like a clunky web browser", particularly when debugging or rendering lots of those components to screen.
What should I think?
Is this best practice?
I guess many people on HN are working at FB....
For those interested, NativeScript is Telerik's answer to React Native and tends to leverage Angular JS as the front end framework. One of the fundamental differences between the two are in how they give you access to device/platform functionality. React Native forces you to drop down to native code when you need access to device or platform functionality not exposed through their framework API. Conversely, NativeScript attempts to expose the device and platform APIs to your JS code. This difference has a very real convenience/performance trade-off.
Status of this project. Can I use it for production?
What are the differences from other starter kits like Este, which also could be used for building react-native and react apps.