vercel-react-native-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
Install
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-react-native-skills- title
- Pass Primitives to List Items for Memoization
- impact
- HIGH
- impactDescription
- enables effective memo() comparison
- tags
- lists, performance, memo, primitives
Pass Primitives to List Items for Memoization
When possible, pass only primitive values (strings, numbers, booleans) as props
to list item components. Primitives enable shallow comparison in memo() to
work correctly, skipping re-renders when values haven't changed.
Incorrect (object prop requires deep comparison):
This can still be optimized, but it is harder to memoize properly.
Correct (primitive props enable shallow comparison):
Pass only what you need:
For callbacks, hoist or use item ID:
Primitive props make memoization predictable and effective.
Note: If you have the React Compiler enabled, you do not need to use
memo() or useCallback(), but the object references still apply.