r/reactnative • • 10h ago

What are some React Native mistakes beginners should avoid?

I'm interested in learning from developers who have experience building production React Native applications.

What mistakes did you make when starting out?

It could be related to navigation, state management, performance, architecture, or anything else.

Would be great to hear some practical lessons.

3 Upvotes

11 comments sorted by

3

u/dawedev 10h ago

Big one is putting everything in one Context or global store, so any change re-renders half the app. Also long lists in a ScrollView instead of FlatList, and staying in Expo Go too long, then finding out the native module you need won't run there without a dev build.

1

u/kenlawlpt 9h ago

+1 on the context. I did that initially and ran into significant memory leaks.

1

u/dawedev 8h ago

Leaks there are often listeners or timers set up in a provider's useEffect without a cleanup. Splitting into small contexts per concern helps the re-renders, and for fast-changing state Zustand with selectors is easier to keep in check.

2

u/frenzied-berserk 8h ago

Don’t be afraid to write native modules instead of relying on a third-party library from some random guy.

1

u/MobileXapps 9h ago

Testing only in debug mode. A release build on Android is a different app: minification, Hermes bytecode, no dev server. Build a release APK on a cheap Android phone every week or two, not just before the launch.

Putting API keys in the JS bundle. Anything in the app can be read, so keys for paid APIs go behind your own backend.

Postponing React Native upgrades. Skipping several versions makes the upgrade a week of work. The Upgrade Helper diff and small steps keep it manageable.

And not having crash reporting with source maps from day one, so the first real crashes come in as unreadable stack traces.

1

u/Orchid_Buddy 8h ago

Not a react native, but a React one: passing anonymous functions to useEffect. Instead, try passing named functions.

Suddenly, you code becomes some much easier to understand and maintain. It's a game changer.

1

u/Calm_Seal170 7h ago

Use native UI rather than designing and building everything from scratch in JS. Use the platform

1

u/YANGBIWAN 6h ago

The biggest one for me was treating the native side like it doesn't exist. RN kind of sells you "just write JS" and I believed it, so when an iOS build broke after a dependency update I couldn't even read the error properly. That knowledge isn't optional, it just shows up later and costs more.

1

u/davidtranjs 2h ago

OTA will be a huge life saver. Put it to your app, and it will save you someday.

1

u/Traditional_Pay_8661 1h ago

Most of the ones that bit us were on the build and release side, not in the JS:

  1. Only ever running dev builds. Build a release version and run it on a real device early, not the week you ship. Some crashes and slow screens only show up in release.
  2. Not committing lockfiles. Commit package-lock.json and ios/Podfile.lock, and use npm ci instead of npm install on CI, so every machine installs exactly the same versions.
  3. Hand-editing ios/ and android/ in an Expo prebuild project. npx expo prebuild --clean regenerates those folders and your edits are gone. Put native changes in app.config or a config plugin instead.
  4. Leaving iOS signing until launch week. Certificates, provisioning profiles and App Store Connect access always take longer than expected. On CI, don't let automatic signing create certificates on throwaway machines; we ended up with a pile of them before switching to one distribution certificate imported on every run.
  5. Skipping several React Native versions at once. Upgrade one version at a time and use the React Native Upgrade Helper to see exactly which native files changed.

0

u/FamiliarOption 10h ago

Don't use js