r/reactnative • • Apr 18 '20

The React Native 10 commandments

  1. Thou shalt never upgrade a react native version without at least having 72 hours of dedicated time.

  2. When you can't figure out what's wrong then delete node_modules, delete Pods, delete DerivedData, delete cache, and rebuild everything.

  3. Something running perfectly on ios has a 50% chance of being laggy on android.

  4. Every library added to your project will break your build at some point in the future.

  5. Never install a library that hasn't been updated in the last 6 3 months.

  6. The answer to your question is in a closed github issue.

  7. Don't be afraid to get into the native code and make changes.

  8. Native code is a frightening place, only make changes as a last resort.

  9. If you close your eyes before running a build command it has a 25% higher chance of building successfully.

  10. All changes made to the native build systems will be forgotten until it breaks your build at a later date.

385 Upvotes

55 comments sorted by

View all comments

12

u/Tayk5 Apr 18 '20

Oh man, this makes me concerned about choosing to learn RN over Flutter. Are there any Flutter devs here willing to share your Flutter experiences versus RN?

10

u/ncuillery Apr 19 '20 edited Apr 19 '20

I work with RN for 4 years, then switch to Flutter these past 6 months. My honest opinion is: Flutter is superior on every aspect. Expect maybe the syntax (I miss JSX a lot), but navigation, integration testing, hot reload,... are way better in Flutter.

I lost faith in RN upgrade after upgrade... Point 1 to point 6 are the damn truth, even for a experienced dev like me.

Oh, and Dart offers a very similar experience as JavaScript + TypeScript except it's built-in into the language. So no library with unsync or inexistant type definitions...

2

u/drink_with_me_to_day Apr 19 '20

Flutter = Flash

1

u/ncuillery Apr 19 '20

Hmmm, not sure what you mean

4

u/drink_with_me_to_day Apr 19 '20

Since Flutter renders everything with its own engine, it's analogous to Flash.

Or similar to releasing an UI framework for Unity. Or Adobe Air. It's just painting everything on it's own.

4

u/verylevelheaded Apr 20 '20 edited Apr 20 '20

I like that it is painting everything. You actually have one codebase and not one pointing to two other underlying codebases. The Flutter apps I've been downloading are night and day better feeling/performance wise.

1

u/drink_with_me_to_day Apr 20 '20

Well, that brings with it a slew of different issues that you might not face, but when you do you can't fix them and they won't be fixed.

There are always tradeoffs

7

u/richpeopleshit Apr 18 '20

Don’t worry, I actually really enjoy working in React native!

6

u/red_arma Apr 19 '20

Wrote my bachelors thesis about building enterprise level apps with both frameworks. They are almost the same and in the end React Native won due to its maturity. For Flutter A LOT is still missing and if you find a package thats bringing a feature that you rely on its made by some small third party company or even just 1 dev and he/they have zero obligation to keep this repository/package updated and fixed for every single update there is. For me its React Native all the way, while Flutter has a much better documentation and workflow/learning curve, while React Native has a older/more mature community with much more packages at hand.
You can use cross-platform development to such an extend that its as good as native development (just embed native code if needed at certain points, just like Instagram), but comparing between cross-platform frameworks themselves, React Native is still ahead. That might look different in 1,5 - 2 years from now.

1

u/Tayk5 Apr 19 '20

Thanks for the breakdown. That helps! I still love the idea of React for mobile development as I can reuse all my state management and programming best practices. I'm hoping I won't hit a roadblock where my apps no longer work or can't be updated. Like you've said RN has a mature community who have already had to solve 99.99% of the issues I'd face.

1

u/rusl1 Apr 19 '20

I used to think that Flutter is a huge joke so I started using React and React Native for many months but in the last two weeks a spent my time on Flutter and god it is just a pleasure to work with it compare to React. The developing experience is way better than RN, libraries are better organized and supported in my opinion, it just works!

0

u/moneckew Apr 18 '20

Bruh, RN is the way. Amazing framework. Look at my app: https://moodflow.co

1

u/pelanggan Apr 19 '20

Wow look awesome man. How do you play video as the background of your screen like that? Looks super cool and performant

2

u/moneckew Apr 19 '20

People who say Flutter is the way clearly haven't spent enough time on RN. RN is easy to learn, specially if you come from webdev like me. Creating layouts is a breeze.

For the Video background just put a Video element with position absolute and zIndex: -1.

For performance make sure to enable Hermes as your JS engine. This has significantly sped up my app. As well as requiring Components as needed and not on app start using Inline Requires.

1

u/more-food-plz Apr 20 '20

They’re both useful and each with its own advantages

1

u/moneckew Apr 20 '20

Yeah sure, RN however has more support and is more mature.

1

u/asharpvan Apr 19 '20

If i may ask. What framework are you using for the charts?

1

u/moneckew Apr 19 '20

The one shown on the website is custom made and I use some react-native-svg-charts for showing pies

1

u/asharpvan Apr 20 '20

Alright. Ill go through the same. Thanks!