Overview
Performance directly impacts user experience. This guide covers techniques to make your Expo app fast and responsive.Measuring Performance
React DevTools Profiler
Install React DevTools:package.json
Performance monitoring hook
hooks/usePerformanceMonitor.ts
Optimizing Renders
React.memo
Prevent unnecessary re-renders:components/UserCard.tsx
useMemo
Memoize expensive calculations:useCallback
Memoize function references:List Performance
FlatList optimization
components/OptimizedList.tsx
FlashList (faster alternative)
FlashList can be 10x faster than FlatList for large lists with consistent item sizes.
Image Optimization
expo-image
Use the optimized Image component:Progressive image loading
components/ProgressiveImage.tsx
Image sizing
Animations
react-native-reanimated
Use for smooth, performant animations:components/AnimatedBox.tsx
Avoid setState in animations
JavaScript Performance
Avoid inline objects and functions
Debounce and throttle
hooks/useDebounce.ts
Web Workers (Expo)
Offload heavy computations:utils/worker.ts
Memory Management
Clean up subscriptions
Cancel pending requests
hooks/useFetch.ts
Avoid memory leaks
Network Optimization
Request deduplication
utils/cache.ts
Pagination
hooks/usePagination.ts
Profiling Tools
Expo Performance Monitor
Custom performance logger
utils/performance.ts
Platform-Specific Optimization
- iOS
- Android
Troubleshooting
Slow initial load
Slow initial load
- Reduce bundle size (see Bundle Size guide)
- Lazy load screens with dynamic imports
- Optimize splash screen assets
- Enable Hermes engine
Janky animations
Janky animations
- Use
useNativeDriver: truefor Animated - Switch to react-native-reanimated
- Avoid setState during animations
- Check for expensive renders during animation
Slow scrolling
Slow scrolling
- Use FlashList instead of FlatList
- Memoize list items with React.memo
- Implement getItemLayout for fixed-size items
- Reduce complexity of list item components
Memory warnings
Memory warnings
- Check for memory leaks (unmounted setState)
- Clean up subscriptions in useEffect
- Cancel pending network requests
- Optimize image sizes and caching
Performance Checklist
- Enable Hermes engine
- Use React.memo for expensive components
- Implement useMemo for expensive calculations
- Use useCallback for stable function references
- Optimize FlatList with proper props
- Use expo-image instead of Image
- Enable useNativeDriver for animations
- Debounce user input handlers
- Clean up useEffect subscriptions
- Cancel pending requests on unmount
- Lazy load routes and components
- Profile with React DevTools
- Monitor bundle size
- Optimize images before upload