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

1

u/[deleted] Apr 23 '20

I've found RN much more pleasant than React, because styling on a huge screen is hard. I don't have CSS skills.

But I find this list almost useless to me, although its probably funny/ sarcastic to a lot of other people.

  1. It took me 2 hours to upgrade to 0.62 from 0.61.5.

  2. Sure, but this is already recommended by RN

  3. Android is easier for me and prefer editing xml and gradle files instead of weirdly formatted XCode proprietary files. Yes, I have an android device.

  4. I did not know this. It might hit me in the future. But all libraries will break in the future if its not maintained: not if its maintained, e.g. https://github.com/airbnb/native-navigation

  5. I've installed old libraries that have worked just fine.

  6. Github issues are always a nice place to find problems, they could be closed or open though.

  7. Don't be afraid? its not about fear, its about skill and knowledge. If you want to change it, know what you're changing, just like anything.

  8. Doesn't this depend on what youre trying to achieve. Change native code IF you need to.

  9. ... thats just made up obviously.

  10. Not if you understand what youre doing. Also, isn't that the same will all code. Forget about it until it breaks or you need to make a change.