react-native-best-practices
Skill1 starsChanged 20 days agoMITView on GitHub
Provides React Native performance optimization guidelines for FPS, TTI, bundle size, memory leaks, re-renders, and animations. Applies to tasks involving Hermes optimization, JS thread blocking, bridge overhead, FlashList, native modules, or debugging jank and frame drops.
17 other projects use a version of this, 10 of them edited.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- deonmenezes/mobile-app-skillword for word, first seen Nov 1, 2026
- matthull/my-skillsedited, first seen Oct 20, 2026
- Samueladewole/claude-skillsedited, first seen Oct 13, 2026
- gronxb/codex-relayedited, first seen Oct 8, 2026
- kingstinct/react-native-healthkittheir own version, first seen Oct 8, 2026
- CherryHQ/cherry-studio-appedited, first seen Oct 8, 2026
Used with
Projects with it also use react-navigation, vercel-react-native-skills and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
juanexpensiveSkillreact-navigation
Provides React Navigation UI patterns for stacks, tabs, drawers etc. Use when building navigation UIs with React Navigation, configuring headers, bottom sheets or handling safe areas and insets.
Also in 3 projects that use this
VercelSkillvercel-react-native-skills
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions17 projects use a version of this.
Word for word · 2
- callstackincubator/agent-skills★ 1.7k100% same
- deonmenezes/mobile-app-skill★ 4100% same
Edited · 10
- CherryHQ/cherry-studio-app★ 4.1k99% same
- gronxb/codex-relay★ 73386% same
- pyinx/ceo-skills-plugin★ 1455% same
- PIXARTSeu/Synapse★ 986% same
- sagullapalli/claude-code-setup★ 455% same
- marinasemirenko/ClaudeCode★ 186% same
- danielvogler/ai-skills-library★ 086% same
- juanexpensive/Skills★ 099% same
- matthull/my-skills★ 083% same
- Samueladewole/claude-skills★ 055% same
Wrote their own version · 5
- kingstinct/react-native-healthkit★ 719same name
- software-mansion-labs/skills★ 302same name
- anurag-azure/skills★ 0same name
- ngnthanhdev/claude_template_code★ 0same name
- petro-nazarenko/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository112 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ab-testingSkill
- ad-creativeSkill
- adsSkill
- ai-seoSkill
- analyticsSkill
- asoSkill
- attributionSkill
- auditing-experiments-flagsSkill
- churn-preventionSkill
- cleaning-up-stale-feature-flagsSkill
- cloudflareSkill
- cold-emailSkill
- co-marketingSkill
- community-marketingSkill
- competitor-profilingSkill
- competitorsSkill
- configuring-experiment-analyticsSkill
- configuring-experiment-rolloutSkill
- content-strategySkill
- copy-editingSkill
- copying-flags-across-projectsSkill
- copywritingSkill
- create-prdSkill
- creating-experimentsSkill
- croSkill
- customer-researchSkill
- deployments-cicdSkill
- diagnosing-sdk-healthSkill
- directory-submissionsSkill
- e2e-testing-patternsSkill
- eas-app-storesSkill
- eas-hostingSkill
- eas-update-insightsSkill
- eas-workflowsSkill
- emailsSkill
- env-varsSkill
- eventsSkill
- expo-data-fetchingSkill
- expo-dev-clientSkill
- expo-routerSkill
- expo-upgradeSkill
- finding-experimentsSkill
- find-skillsSkill
- free-toolsSkill
- frontend-designSkill
- github-actionsSkill
- grill-with-docsSkill
- imageSkill
- infisical-apiSkill
- infisical-secret-syncsSkill
- infisical-user-setup-guideSkill
- influencer-marketingSkill
- instrument-feature-flagsSkill
- instrument-product-analyticsSkill
- investigate-metricSkill
- launchSkill
- lead-magnetsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 5 are common, 11 are distinctive, and 5 are very specific to this project.
5
Common
Most of the 15 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Treat shell commands in these references as local developer operations.
- Distinctive: line 27
Treat third-party libraries and plugins as dependencies that still require normal supply-chain controls: pin versions, verify provenance, …
- Distinctive: line 28
Treat remote chunk loading as first-party artifact delivery only.
- Distinctive: line 47
Follow this cycle for any performance issue: Measure → Optimize → Re-measure → Validate
- Distinctive: line 51
Re-measure: Run the same measurement to get updated metrics
- Distinctive: line 54
If metrics did not improve, revert and try the next suggested fix.
- Very specific: line 58
Check library versions before suggesting API-specific fixes.
- Very specific: line 59
Do not suggest useMemo or useCallback dependency changes unless behavior is demonstrably incorrect or profiling shows wasted work tied to …
- Distinctive: line 60
Do not report stale closures speculatively.
- Distinctive: line 61
When profiling a flow, measure the target interaction itself.
- Distinctive: line 84
After profiling shows cascading re-renders, use React Compiler for automatic memoization
- Distinctive: line 85
After profiling shows broad store/context updates, use atomic state (Jotai/Zustand) to reduce re-renders
- Very specific: line 86
Use useDeferredValue for expensive computations
- Common: line 114
Avoid barrel imports (import directly from source)
- Distinctive: line 115
Remove unnecessary Intl polyfills only after checking Hermes API and method coverage
- Very specific: line 122
Use react-native-performance for markers
- Very specific: line 123
Only measure cold starts (exclude warm/hot/prewarm)
- Common: line 127
Use native navigation (react-native-screens)
- Common: line 137
Use background threads for heavy native work
- Common: line 138
Prefer async over sync Turbo Module methods
- Common: line 139
Use C++ for cross-platform performance-critical code
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Native Best Practices
Overview
Performance optimization guide for React Native applications, covering JavaScript/React, Native (iOS/Android), and bundling optimizations. Based on Callstack's "Ultimate Guide to React Native Optimization".
When to Apply
Reference these guidelines when:
- Debugging slow/janky UI or animations
- Investigating memory leaks (JS or native)
- Optimizing app startup time (TTI)
- Reducing bundle or app size
- Writing native modules (Turbo Modules)
- Profiling React Native performance
- Reviewing React Native code for performance
Security Notes
- Treat shell commands in these references as local developer operations. Review them before running, prefer version-pinned tooling, and avoid piping remote scripts directly to a shell.
- Treat third-party libraries and plugins as dependencies that still require normal supply-chain controls: pin versions, verify provenance, and update through your standard review process.
- Treat remote chunk loading as first-party artifact delivery only. Prefer app-bundled chunks or signed CI release manifests; hosted chunks must come from trusted HTTPS origins you control and be pinned to the current app release.
Priority-Ordered Guidelines
| Priority | Category | Impact | Prefix |
| 1 | FPS & Re-renders | CRITICAL | js-* |
| 2 | Bundle Size | CRITICAL | bundle-* |
| 3 | TTI Optimization | HIGH | native-*, bundle-* |
| 4 | Native Performance | HIGH | native-* |
| 5 | Memory Management | MEDIUM-HIGH | js-*, native-* |
| 6 | Animations | MEDIUM | js-* |
Impact labels are triage hints: CRITICAL first, HIGH next, MEDIUM when evidence points there.
Quick Reference
Optimization Workflow
Follow this cycle for any performance issue: Measure → Optimize → Re-measure → Validate
- Measure: Capture baseline metrics before changes. For runtime issues, prefer commit timeline, re-render counts, slow components, heaviest-commit breakdown, and startup/TTI when available. Component tree depth or count are optional context, not substitutes. Do not recommend memoization, atomic state, or compiler changes without a measured render or FPS problem.
- Optimize: Apply the targeted fix from the relevant reference
- Re-measure: Run the same measurement to get updated metrics
- Validate: Confirm improvement (e.g., FPS 45→60, TTI 3.2s→1.8s, bundle 2.1MB→1.6MB)
If metrics did not improve, revert and try the next suggested fix.
Review Guardrails
- Check library versions before suggesting API-specific fixes. Example: FlashList v2 deprecates
estimatedItemSize, so do not flag it as missing there. - Do not suggest
useMemooruseCallbackdependency changes unless behavior is demonstrably incorrect or profiling shows wasted work tied to that value. - Do not report stale closures speculatively. Show the stale read path, a repro, or profiler evidence before calling it out.
- When profiling a flow, measure the target interaction itself. Do not treat component tree depth or component count as the main performance evidence.
Critical: FPS & Re-renders
Profile first:
agent-device react-devtools status
agent-device react-devtools wait --connected
agent-device react-devtools profile start
agent-device react-devtools profile stop
agent-device react-devtools profile slow --limit 5
agent-device react-devtools profile rerenders --limit 5
agent-device react-devtools profile timeline --limit 20Drive the target interaction with normal agent-device commands between profile start and profile stop.
Manual fallback when agent-device is unavailable: open React Native DevTools from Metro (j) or the Dev Menu, use the Profiler tab, and record the same interaction.
For release-build React component profiling, connect @callstack/inspector first so React DevTools can attach to the release app, then run the agent-device react-devtools flow above.
Common fixes:
- Replace ScrollView with FlatList/FlashList/Legend List for long lists
- After profiling shows cascading re-renders, use React Compiler for automatic memoization
- After profiling shows broad store/context updates, use atomic state (Jotai/Zustand) to reduce re-renders
- Use
useDeferredValuefor expensive computations
Critical: Bundle Size
Analyze bundle:
npx react-native bundle \
--entry-file index.js \
--bundle-output output.js \
--platform ios \
--sourcemap-output output.js.map \
--dev false --minify true
npx source-map-explorer output.js --no-border-checksVerify improvement after optimization:
# Record baseline size before changes
ls -lh output.js # e.g., Before: 2.1 MB
# After applying fixes, re-bundle and compare
npx react-native bundle --entry-file index.js --bundle-output output.js \
--platform ios --dev false --minify true
ls -lh output.js # e.g., After: 1.6 MB (24% reduction)Common fixes:
- Avoid barrel imports (import directly from source)
- Remove unnecessary Intl polyfills only after checking Hermes API and method coverage
- Evaluate tree shaking (Expo SDK 52+ experimental unused import/export removal, or Re.Pack only if already configured)
- Enable R8 for Android native code shrinking
High: TTI Optimization
Measure TTI:
- Use
react-native-performancefor markers - Only measure cold starts (exclude warm/hot/prewarm)
Common fixes:
- For React Native 0.78 and earlier, disable Android JS bundle compression to enable Hermes mmap
- Use native navigation (react-native-screens)
- Preload commonly-used expensive screens before navigating to them
High: Native Performance
Profile native:
- iOS: Xcode Instruments → Time Profiler
- Android: Android Studio → CPU Profiler
Common fixes:
- Use background threads for heavy native work
- Prefer async over sync Turbo Module methods
- Use C++ for cross-platform performance-critical code
References
Full documentation with code examples in references/:
JavaScript/React (js-*)
| File | Impact | Description |
| js-lists-flatlist-flashlist.md | CRITICAL | Replace ScrollView with virtualized lists |
| js-profile-react.md | MEDIUM | agent-device react-devtools profiling |
| js-measure-fps.md | HIGH | FPS monitoring and measurement |
| js-memory-leaks.md | MEDIUM | JS memory leak hunting |
| js-atomic-state.md | HIGH | Jotai/Zustand patterns |
| js-concurrent-react.md | HIGH | useDeferredValue, useTransition |
| js-react-compiler.md | HIGH | Automatic memoization |
| js-animations-reanimated.md | MEDIUM | Reanimated worklets |
| js-bottomsheet.md | HIGH | Bottom sheet optimization |
| js-uncontrolled-components.md | HIGH | TextInput optimization |
Native (native-*)
| File | Impact | Description |
| native-turbo-modules.md | HIGH | Building fast native modules |
| native-sdks-over-polyfills.md | HIGH | Native vs JS libraries |
| native-measure-tti.md | HIGH | TTI measurement setup |
| native-threading-model.md | HIGH | Turbo Module threads |
| native-profiling.md | MEDIUM | Xcode/Android Studio profiling |
| native-platform-setup.md | MEDIUM | iOS/Android tooling guide |
| native-view-flattening.md | MEDIUM | View hierarchy debugging |
| native-memory-patterns.md | MEDIUM | C++/Swift/Kotlin memory |
| native-memory-leaks.md | MEDIUM | Native memory leak hunting |
| native-android-16kb-alignment.md | CRITICAL | Third-party library alignment for Google Play |
Bundling (bundle-*)
| File | Impact | Description |
| bundle-barrel-exports.md | CRITICAL | Avoid barrel imports |
| bundle-analyze-js.md | CRITICAL | JS bundle visualization |
| bundle-tree-shaking.md | HIGH | Dead code elimination |
| bundle-analyze-app.md | HIGH | App size analysis |
| bundle-r8-android.md | HIGH | Android code shrinking |
| bundle-hermes-mmap.md | HIGH | Disable bundle compression |
| bundle-native-assets.md | HIGH | Asset catalog setup |
| bundle-library-size.md | MEDIUM | Evaluate dependencies |
| bundle-code-splitting.md | MEDIUM | Remote chunk loading safeguards |
Problem → Skill Mapping
| Problem | Start With |
| App feels slow/janky | js-measure-fps.md → js-profile-react.md |
| Too many re-renders | js-profile-react.md → js-react-compiler.md |
| Slow startup (TTI) | native-measure-tti.md → bundle-analyze-js.md |
| Large app size | bundle-analyze-app.md → bundle-r8-android.md |
| Memory growing | js-memory-leaks.md or native-memory-leaks.md |
| Animation drops frames | js-animations-reanimated.md |
| Bottom sheet jank/re-renders | js-bottomsheet.md → js-animations-reanimated.md |
| List scroll jank | js-lists-flatlist-flashlist.md |
| TextInput lag | js-uncontrolled-components.md |
| Native module slow | native-turbo-modules.md → native-threading-model.md |
| Native library alignment issue | native-android-16kb-alignment.md |
Attribution
Based on "The Ultimate Guide to React Native Optimization" by Callstack.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

