r/reactnative • • 4d 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

18 comments sorted by

5

u/dawedev 3d 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.

2

u/kenlawlpt 3d ago

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

1

u/dawedev 3d 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.

1

u/bikeslide 3d ago

what should we do in this/ avoid this situation?
"finding out the native module you need won't run there without a dev build"

3

u/dawedev 3d ago • Bravo

Switch to a dev build as soon as you add anything outside the Expo SDK. Add expo-dev-client, build once with EAS or npx expo run:ios, and use that instead of Expo Go from then on.

3

u/frenzied-berserk 3d ago

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

2

u/MobileXapps 3d 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.

2

u/Orchid_Buddy 3d 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.

2

u/davidtranjs 3d ago

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

2

u/Traditional_Pay_8661 3d 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.

1

u/Calm_Seal170 3d ago

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

1

u/YANGBIWAN 3d 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/atta542 3d ago

a few other common ones. testing only on the simulator and a fast dev machine, then finding out a release build on a cheap android phone behaves very differently. get a release build onto a real low end device early, not the week before launch. keyboard handling and safe areas are another one, they look fine on one phone and break on the next, so pick one approach and stick with it. also set up navigation and the auth flow properly at the start, because reworking it later touches every screen. and watch image sizes, big unoptimized images cause more jank than most code does.

1

u/ozgur_builds 1d ago

one that bit me: not testing the path where the user says no. my app needs the alarm permission and during app review the reviewer tapped don't allow. my "open settings" button didn't work on their device and i only found out from sentry. now every permission gets a test where i deny it first.

also the simulator doesn't always behave like a phone for permissions. the iOS 27 sim auto-denies the AlarmKit permission, so i lost an evening thinking my code was broken. test anything permission related on a real device

-1

u/FamiliarOption 3d ago

Don't use js