react-native-performance
Skill1 starsChanged 2 months agoMITView on GitHub
Make a React Native app fast by working with the JS/UI thread split rather than around it - list virtualisation (FlatList vs FlashList vs ScrollView), image sizing and caching, Reanimated over Animated, avoiding inline objects and functions, and the New Architecture (JSI/Fabric/TurboModules). Use when the app drops frames, when scrolling stutters, when a screen "feels heavy", when startup is slow, or when profiling with the DevTools/perf monitor finds long JS tasks or a bridge bottleneck. Triggers on "scrolling laggy", "jank", "dropped frames", "useNativeDriver", "FlashList", "re-render loop", "slow list", "bridge", "Fabric", "Hermes", "UI thread", "heavy screen".
2 other projects use a version of this.
Adopted by
Most recently taken up by
- evolplus/talostheir own version, first seen Nov 22, 2026
- maikotrindade/awesome-react-native-skillstheir own version, first seen May 21, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- maikotrindade/awesome-react-native-skills★ 13same name
- evolplus/talos★ 9same 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 repository126 other files it gives its agents.
- eu-data-backend-job-hunterSkill
- job-application-matcherSkill
- llm-agents-and-tool-useSkill
- llm-application-architectureSkill
- llm-cost-and-latency-optimizationSkill
- llm-evaluationSkill
- llm-fine-tuning-and-adaptersSkill
- llm-privacy-and-safetySkill
- llm-prompt-engineeringSkill
- llm-rag-systemsSkill
- structured-output-and-jsonSkill
- graphql-api-designSkill
- pagination-and-filteringSkill
- rest-api-designSkill
- webhooks-and-integrationsSkill
- caching-architecture-multi-layerSkill
- resilience-patternsSkill
- service-boundaries-and-monolithsSkill
- system-design-interviewSkill
- go-concurrencySkill
- go-error-handlingSkill
- java-spring-patternsSkill
- nodejs-server-performanceSkill
- python-async-patternsSkill
- python-data-modelingSkill
- python-packaging-and-toolingSkill
- python-performanceSkill
- rest-api-implementationSkill
- rust-error-handlingSkill
- rust-ownership-patternsSkill
- typescript-type-safetySkill
- ci-caching-and-speedupSkill
- ci-pipeline-designSkill
- deployment-strategiesSkill
- github-actions-hardeningSkill
- release-versioning-and-changelogsSkill
- reproducible-buildsSkill
- aws-iam-and-securitySkill
- aws-serverless-architectureSkill
- azure-fundamentalsSkill
- cloud-cost-optimizationSkill
- cloud-networking-and-vpcSkill
- gcp-cloud-architectureSkill
- code-review-skillsSkill
- design-review-and-refactoring-architectureSkill
- refactoring-techniqueSkill
- understanding-unknown-codebaseSkill
- buildkit-and-cacheSkill
- container-image-debuggingSkill
- container-runtime-securitySkill
- docker-compose-workflowsSkill
- dockerfile-authoringSkill
- docker-image-optimizationSkill
- database-connection-managementSkill
- database-transactionsSkill
- distributed-databasesSkill
- nosql-data-modelingSkill
- postgres-query-tuningSkill
- redis-and-cachingSkill
- schema-migrationsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
The core lever: run animation and gesture work on the UI thread (useNativeDriver, Reanimated) so the JS thread is free to handle input and …
- Very specific: line 46
Never ScrollView.map() a long list — it renders everything and holds it all in memory.
- Very specific: line 85
Memoise the item component and its props: If a row's props include { onPress: () => ...
- Very specific: line 202
If you're on an older RN, you can opt in via newArchEnabled in android/gradle.properties and RCT_NEW_ARCH_ENABLED, but third-party libs …
- Distinctive: line 213
Fabric caveats: not every legacy native module/view is Fabric-ready.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
React Native Performance
A React Native frame has a budget of ~16.7ms (60Hz) or ~8.3ms (120Hz). A frame that misses it drops. Everything on this page is about keeping both the JS thread and the UI thread under budget, in the right places.
The model: two threads
- JS thread: runs your React code, reconciler, business logic, and (historically) the bridge serialiser. A long JS task blocks all new React work — including a touch handler, so taps feel laggy.
- UI thread (native/main): draws the view hierarchy and runs native animations. With the New Architecture, the Fabric renderer and native Reanimated work run here, largely off the JS thread.
- Bridge (legacy): serialised JSON messages between JS and native. In the
Old Architecture every
setStateproducing a view update, and everyAnimatedvalue not usinguseNativeDriver, crosses it. Under the New Architecture, JSI and the TurboModule system replaced the async bridge for most data, and the Fabric renderer makes view mounting cheaper.
The core lever: run animation and gesture work on the UI thread
(useNativeDriver, Reanimated) so the JS thread is free to handle input and
state the instant it arrives.
Workflow
Progress:
- 1. Enable the New Architecture + Hermes (they are the default in RN 0.76+; confirm, don't assume)
- 2. Profile with the right tool — don't guess (below)
- 3. Find the long JS task or the expensive re-render
- 4. Fix the render cost (memo, list, image) or move it off the JS thread
- 5. Re-profile on a release build on a mid/low device
Lists: the most common jank source
Never ScrollView.map() a long list — it renders everything and holds it all in
memory. Use a virtualised list.
| List | Use when | Notes |
FlatList | Default. You need basics: data, keyExtractor, renderItem, getItemLayout. | Virtualises; tuning it is manual |
FlashList (Shopify) | You have real scroll perf problems or very large/complex items | v2 requires New Architecture; auto-size-on-draw (no more "why is my list blank?"); recycle aggressively. The upgrade from FlatList is usually worth it |
SectionList | Grouped data | Virtualised; often fine on top of the above |
ScrollView | A handful of non-virtualised items | Fine for <~10 static children; a trap beyond that |
Tuning that matters:
<FlatList
data={rows}
keyExtractor={(r) => r.id} // stable, from the model
renderItem={renderRow} // hoisted, not an inline arrow
getItemLayout={(_, index) => ({ length: ROW_H, offset: ROW_H * index, index })}
initialNumToRender={10} // first paint
maxToRenderPerBatch={10} // per JS-thread slice
windowSize={7} // screens of content to keep mounted
removeClippedSubviews // Android: detach offscreen views (helps huge lists; can blank fast scroll — test)
updateCellsBatchingPeriod={50} // batch prop changes
/>renderItemmust be a stable reference and must not create new objects or closures per row. A new inline arrow each render recreates every row component:// Wrong: new component type per render → full remount, no memo help. renderItem={({ item }) => <Row item={item} onPress={() => go(item.id)} />} // Better: stable component + memo + stable per-row data. const Row = memo(function Row({ item, onPress }) { return <Pressable onPress={onPress} … />; }); // Pass the id, not a new arrow: the list binds the handler per item. renderItem={({ item }) => <Row item={item} onPress={handlePress} />}- Memoise the item component and its props. If a row's props include
{ onPress: () => ... }or a styled object literal,memonever hits. Pass primitives/ids and stable handlers (see below). getItemLayoutlets the list jump to an offset without measuring — a big win for fixed-height rows and forscrollToIndex.keyExtractorfrom the data id, never the array index — index keys break memoisation and reorder badly.
Images
Images are a huge cost (decode memory, network, and layout) and a common cause of blank-then-pop rows.
- Always set explicit
width/height(oraspectRatio) on<Image>. An unsized image reserves no space, so the row relayouts as it loads (jank + flicker). With Fast Refresh you can see rows "pop". - Size the source to the rendered size × DPR. A 4000px image in a 200pt row
wastes memory and decode time. Use
resizeMode="cover"+ correctwidth. - Use a caching image component, not bare
<Image>, if you're loading remote images:@d11/react-native-fast-image(orexpo-image) caches to disk, decodes off-thread, and avoids the placeholder-flash that bareImagegives on scroll. FastImage is archived; for new work on Expo,expo-image(with a memory/disk cache) is the current default. On bare RN,react-native-fast-imagestill works but is in maintenance — verify maintenance status before adopting. cache: 'only-from-network' | 'only-from-disk' | 'default'onImagecontrols caching; set it deliberately for images that change server-side.- Decode memory is the real cost: a 4000×3000 image ≈ 48MB in memory
(width × height × 4 bytes). Virtualised lists that keep too many large
bitmaps alive are a common OOM — see the
mobile-crash-and-perf-diagnosticsskill.
Animation: Reanimated over Animated
AnimatedwithuseNativeDriver: trueruns the animation on the UI thread.useNativeDriver: false(the default for some props) runs it on the JS thread and drops frames whenever the JS thread is busy. If you animateleft/top/width/height/backgroundColorwithAnimated, you cannot use the native driver — that is a reason to use Reanimated.- Reanimated (v2/v3/v4) runs worklets on the UI thread and is the default
choice for RN animation and gestures in new code. It can animate any
transform/layout prop, and its
useAnimatedStylenever touches the JS thread per frame.import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated'; const x = useSharedValue(0); const style = useAnimatedStyle(() => ({ transform: [{ translateX: x.value }] })); // onPanResponder / Gesture.Pan().onUpdate(e => { x.value = e.translationX; })- v3 needs the Babel plugin (
react-native-reanimated/plugin, last in the plugins list) and works on the UI thread. v4 (Reanimated 4) is New Architecture–only. Check your version; on the New Architecture prefer v4, on the Old Architecture v3.
- v3 needs the Babel plugin (
- Animate
transform(translate/scale/rotate), nottop/left/width— transforms are cheap on both architectures; layout props are not. - Gesture Handler (
react-native-gesture-handler) runs gestures on the UI thread and pairs with Reanimated; prefer it over PanResponder for anything scroll-linked or high-frequency. LayoutAnimationis unreliable across the New Architecture/Fabric for list reordering; don't build critical UX on it. Reanimated layout animations (LinearTransition,Layout) are the supported path.
Render-cost rules
The RN render is synchronous-ish work on the JS thread; make each render cheap and make renders not happen.
React.memoevery list row and any heavy leaf. Compare the props you actually pass; a new object/array/function prop defeats it.- No inline objects or functions in props/styles. A new
style={{…}},source={{uri}}, oronPress={() => …}per render is a new reference each time. Hoist, memoise, or useStyleSheet.create(which returns stable objects) and stableuseCallbackhandlers.// Wrong: new object each render. <View style={{ padding: 8 }} /> // Right: stable, and flattened for native. const s = useMemo(() => ({ padding: 8 }), []); // Or stylesheet (stable + flattened): const styles = StyleSheet.create({ box: { padding: 8 } }); useCallback/useMemoonly to protect identity, not for micro-gains. They cost a little; they buy referential stability formemo/effects. Use them for props passed to memoised children and for effect deps, not everywhere.- Don't compute heavy work in render (sorting/filtering a big array, JSON parsing). Memoise on the inputs, or move it to a memoised selector, or precompute in a store.
FlatList+ a state store that re-renders the whole list on every keystroke: keep transient UI state (search text) local to the search bar so typing doesn't re-render the results list.
JS vs UI thread: the decision
| Work | Where it should run | How |
| Touch/gesture tracking, drag, swipe | UI thread | Reanimated + Gesture Handler worklets |
| Animations (transform, opacity, progress) | UI thread | Reanimated / Animated + native driver |
| List scrolling and windowing | native/UI (RN's list) | FlatList/FlashList (not a JS ScrollView) |
| Data fetch, business logic, state | JS thread | Keep it off the frame budget; don't block |
| Heavy compute (parse, sort, crypto, image) | off main | InteractionManager.runAfterInteractions, a worker (react-native-multithreading/JSI), or move to native |
| Navigating on a tap | JS (handler) but keep the handler tiny | Don't do heavy work in onPress before navigating |
InteractionManager.runAfterInteractions(() => …) defers non-visual work until
animations/gestures settle — use it for logging, prefetching, and analytics
rather than blocking a frame.
The New Architecture (JSI / Fabric / TurboModules)
- What it is: React Native's New Architecture replaces the async bridge with
JSI (direct JS↔native object access, sync), a Fabric renderer (view
layer built natively, cheaper mounting, better offscreen/texture support), and
TurboModules/
TurboModuleRegistry(typed, synchronous-capable native module interface). - Status: opt-in from 0.68; default from RN 0.76 (0.76+ ships New
Architecture on by default, and the legacy architecture is deprecated/being
removed). Expo SDK 52 (RN 0.76) and later default to the New Architecture.
If you're on an older RN, you can opt in via
newArchEnabledinandroid/gradle.propertiesandRCT_NEW_ARCH_ENABLED, but third-party libs with native code must be New-Arch-compatible. - Why it matters for perf: less bridge serialisation, cheaper list/view
mounting, synchronous native calls. It helps but it does not rescue bad
render code — the same
renderItemanduseEffectproblems still drop frames, because the JS thread is still the JS thread. - Hermes is the default JS engine (on both Android and iOS from RN 0.76, and recommended on earlier versions too). It precompiles your bundle and generally starts faster and uses less memory than JSC. Keep Hermes; don't switch to JSC for a perf fix — the fix is almost always elsewhere.
- Fabric caveats: not every legacy native module/view is Fabric-ready. Interop layers exist but with caveats; a non-Fabric component can be the jank source. If a screen is inexplicably slow under Fabric, suspect a non-Fabric native dependency.
Profiling: don't guess
- React DevTools Profiler (works in RN): flame chart, commit times, "why did this render" (double-tap a component in the flame chart). Look for long commits and re-render frequency.
- Flipper is retired (Meta sunset it; the successor is the RN DevTools frontend). Don't build a workflow around Flipper.
- RN DevTools (in newer RN) — the current standalone debugger/performance tooling. Check your version's docs for the exact menu.
- Perf Monitor (in dev,
dev menu → Performance): shows FPS and, with the New Architecture, JS/UI frame times; the in-app FPS overlay (RedBox FPS Monitor) is a fast field signal. - On device, use a release build (
--mode releasein Metro/react-native run-android --mode release). Dev builds are slower and the StrictMode-like dev behaviours mislead. Profile a real mid-range device, not a simulator. - Android:
adb shell dumpsys gfxinfo <pkg> framestats, or Perfetto/dumpsys gfxinfo. iOS: Instruments (Time Profiler, Allocations, Animation Hitches), Xcode's "Slow Animations"/"Debug Color Layer" toggles. - The Perf Monitor FPS number dropping below ~55–60 means frames are being
missed; profile the trace, don't add
console.logand guess.
Gotchas
useNativeDrivercannot animatebackgroundColor,borderColor,width,height,top,left,flex— those must stay on the JS thread withAnimated, which is why Reanimated (UI thread) is preferred.- A
useEffectthat sets state on every render, or a store subscription that re-renders the whole screen, is the classic "list flickers/scrolls jump" cause. Keep the data flowing one way and stable. console.login RN is expensive in release too on some platforms and always costs a bridge/console hop in dev; strip logs before shipping.- FlatList
windowSizetoo high keeps too many rows mounted (memory); too low and fast scroll shows blanks. Tune withremoveClippedSubviewsoff first, then adjust. removeClippedSubviewscan cause blank cells on fast scroll / iOS edge cases. It's Android-oriented; test on iOS before shipping it.- The bridge is not your bottleneck under the New Architecture, but a
legacy module or a
setNativePropsin a loop can still block. Look at the UI-thread time, not just JS time. setNativeProps/setNativePropsin a loop bypasses React and can conflict with re-renders; prefer Reanimated shared values.- Hermes makes JS faster but the main thread can still be saturated by React reconciliation; faster JS ≠ fewer frames if you're re-rendering everything.
- Dev-mode double rendering (StrictMode / the dev bundle) inflates frame counts; never tune on the dev FPS number.
- Sorting/filtering inside
renderItemor auseMemowith wrong deps is a common "why is the list slow" that has nothing to do with the list. - A single giant component (one screen, 2000 lines) is hard to memoise; split into memoised leaves so a re-render doesn't re-reconcile the whole tree.
Review checklist
- Hermes + New Architecture on (RN 0.76+ default; confirm the app config).
- Long lists are
FlatList/FlashList, never mappedScrollViews. renderItemis a stable, memoised component with primitive/stable props and akeyExtractorfrom the model id.- Animations/gestures on the UI thread (Reanimated/native driver), on transforms.
- No inline object/array/function props or style objects in hot paths;
StyleSheet.create/useMemowhere identity matters. - Every
Imagehas explicit dimensions and is appropriately sized. - No heavy compute or
setStatein render; non-visual work deferred withInteractionManager. - Profiled on a release build on a mid-range device, not guessed from dev.
Files
references/perf-recipes.md— copy-paste patterns for list tuning, memoised rows, Reanimated setup, and a profiling decision table.
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.

