18

Facebook: Ok, so we have this really cool idea for native Android and iOS app with React
Devs: Nice!
Facebook: Its gonna take away the need to work with native code!
Devs: Great!

*Reality comes in*
Reality: To make anything work you need to modify native code and use more hacks than there are useless npm packages

Comments
  • 6
    Google is having the same idea unfortunately ....
    *looking at you flutter/dart*
  • 0
    @dUcKtYpEd You should like it, its dart based, look for Flutter it takes away the need to learn Java/Kotlin or Swift. but same as react lots of things required for talking with hardware. And even JSON parsing (as far as I recall)
  • 1
    Talk about hacks, spent last 5 hours on them
  • 0
    @gitpush I'm no native mobile dev, but as far as I can tell flutter works unlike react native... Flutter brings it's own god damn renderer and compiles dart to native code while react native is just js in a web view (and then a bridge with native views and stuff, plus they've got descriptive programing for animations which is nice but to little to late...)
    Sure you'll still rely on native packages to expose device apis, but apart from that you should be able to do most things in pure flutter/dart.
  • 0
    So happy Facebook rejected me. I am so happy doing Native Code.

    Although React would get me free breakfast, lunch, dinner, massages, laundry, nap rooms,.. not sure what other perks you get at Facebook.. hmm more money.. maybe..

    Not sure I am so happy now.
  • 0
    @Wack define compiles to native code. You're saying if I fetch data from API my fetching code is compiled to Obj-C/Java? Or only layout code? Code for handling state is also compiled not native (not talking about widgets, but packages like redux flutter)?
  • 0
    @gitpush for flutter it will compile every thing down to java/kotlin/obective c/swift. On android it can even go down to arm assembly. Flutter works by bringing it's own renderer (like unity does) which makes it possible to run every thing at 60fps and not have some code (like the controllers and stuff) being executed as js.
  • 1
    @Wack I wouldn't trust anything until I work with it, I heard the same thing about React, Xamarine, Ionic ...etc and all had their ups and downs that usually in Native get solved in a completely different way.

    Moreover; talking with hardware still require native code, and it is like wrapping native SDK with flutter/react native packages.

    It will solve the issue of multi code base, but what about large scale apps? Performance? State handling for complex scenarios?
  • 0
    @gitpush wouldn't expect anything less from a dev ;)

    I'd encurage you to try it for a small thing. And don't get me wrong, it's not perfect (yet). If you want to use material design, it's perfect, you can use other visuals, but it's not as easy, as just using material design.
  • 0
    I've actually just tried react-native-navigation, and it is so fast. I found out that react-navigation is defacto a large react page all rendered in a single component, whilst RNN registers every screen/component, that is then used to build a native layout.
  • 0
    @dUcKtYpEd No idea, it took a long time to set it up and stuff, but its so god damn good. I'm actually making a tempalte project, thats has a lot of native stuff already in it and linked, like notifications and stuff, so you pretty much just get the template, rename the Android/iOS packages, put in your configs and ur good to go. Prolly gonna put it on github before we use it at work lmao. We have been reusing the same project for 3 apps now, cause we didn't have the time to make a new clean project and link the stuff all over again.
  • 1
    @MarcusMorter Get ready to handle white screen when app wakes from background :)
    And if you don't handle screen registering correctly hello OOM

    @Wack My point is so far those frameworks excel at creating user interface, but when it comes to building logic they fail in performance.
  • 1
    @gitpush so far to be honest I've just used it for hackathon and toy project stuff, it handled pretty well. There are some demos available from google as well to stresstest it. But ultimativly I guess you'd have to test it yourself.
  • 1
    @Wack it is on my list but what I don't have is time XD
  • 0
    @gitpush you mean if i leave the app in the background for a longer time, and then bring it back up? cause just putting it in there and bringing it up does nothing out of the ordinary
  • 0
    @MarcusMorter Yes leave it for 5 or 10 minutes it will come back in white screen. I updated to latest version and not sure if it actually got solved or the testing team didn't get the time to test it lol
  • 1
    @gitpush Hmm, cause I haven't encountered any issues yet. Even tried the waiting game to see and it worked ok, I'm on RN 58.5 and RNN 2.12
  • 0
    @MarcusMorter ok that is great to hear :D
    Let's see when we can schedule an update :\
Add Comment