TechnicalMedium React Native
How do you find and fix performance problems in a React Native app?
Asked for Mobile Developer
Why they ask this: Shows practical debugging experience beyond building happy-path screens.
Answer
Measure first:
- Turn on the Perf Monitor in the dev menu to watch JS and UI frame rates.
- Use React DevTools Profiler to find components that re-render too often.
- Use Android Studio and Xcode profilers for memory and native issues.
- Always test a release build on a real, low-end Android phone, which is what many users in Nepal have.
Common fixes:
- Use
FlatList(or FlashList) with stable keys instead of mapping long arrays in aScrollView. - Avoid unnecessary re-renders with
React.memo,useCallbackanduseMemo, and keep state close to where it is used. - Resize and cache images, for example with
expo-image. - Run animations on the UI thread with Reanimated, or
useNativeDriver: true. - Move heavy work off the JS thread and remove
console.logcalls from release builds. - Make sure the Hermes engine is enabled (the default in current versions).
Can you explain this in your own words?