react-native-best-practices

Diagnose and optimize React Native performance across FPS, TTI, bundle size, and memory.

Updated Jul 17, 2026
One-click install
npx skills add https://github.com/usmangurowa/socialmocks --skill react-native-best-practices-usmangurowa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-native-best-practices
Source: https://github.com/usmangurowa/socialmocks/tree/main/.agents/skills/react-native-best-practices
Command: npx skills add https://github.com/usmangurowa/socialmocks --skill react-native-best-practices-usmangurowa

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React Native apps often suffer from janky scrolling, slow startup times, bloated bundles, and memory leaks that are hard to diagnose without structured guidance. This Skill provides a prioritized, reference-backed playbook for identifying and fixing performance issues across the JavaScript, native, and bundling layers. ## Core Features & Use Cases - FPS & Re-render Optimization: Replace ScrollView with FlatList/FlashList, apply React Compiler memoization, use atomic state (Jotai/Zustand), and leverage Concurrent React features like useDeferredValue. - Bundle & App Size Reduction: Analyze bundles with source-map-explorer or Expo Atlas, eliminate barrel imports, enable tree shaking, and apply R8 code shrinking on Android. - TTI & Native Performance: Measure startup with react-native-performance, enable Hermes memory mapping, build efficient Turbo Modules, and profile with Xcode Instruments or Android Studio. - Use Case: When a user reports that a list scrolls at low FPS, follow the problem-to-reference mapping to measure FPS, profile React re-renders, then migrate the list to FlashList with estimatedItemSize. ## Quick Start Ask the assistant to diagnose why your React Native app feels janky during scrolling and apply the recommended list and re-render optimizations.

Frequently Asked Questions about react-native-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix janky scrolling in a React Native list?

Replace ScrollView with FlatList or FlashList so only visible items render. FlashList recycles views and performs best; provide estimatedItemSize and a stable keyExtractor, and avoid inline renderItem functions.

How to reduce React Native bundle size?

Analyze the bundle with source-map-explorer or Expo Atlas, then remove barrel imports, enable tree shaking (Expo SDK 52+), drop unnecessary polyfills, and enable R8 on Android for native code shrinking.

FlatList vs FlashList: which should I use?

FlashList from Shopify recycles views instead of creating new ones, scoring significantly higher in scroll benchmarks. Use FlatList for moderate lists and FlashList for lists over 100 items or complex layouts.

Does tree shaking work with Metro bundler?

Stock Metro does not support tree shaking. Expo SDK 52+ offers experimental tree shaking via environment flags, and Re.Pack (Webpack/Rspack) has it built in. Direct imports remain the reliable manual alternative.

Why is my React Native app startup slow on Android?

A common cause is JS bundle compression blocking Hermes memory mapping. Disable compression via noCompress in build.gradle (default in RN 0.79+), defer non-critical work with InteractionManager, and measure cold-start TTI with react-native-performance.

When should I not use code splitting in React Native?

Avoid code splitting when using Hermes, since its memory mapping already loads bytecode lazily and splitting adds marginal benefit. It also adds complexity unsuitable for small apps or simple navigation.