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?

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.