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
- Avoid Inline Objects in renderItem
- impact
- HIGH
- impactDescription
- prevents unnecessary re-renders of memoized list items
- tags
- lists, performance, flatlist, virtualization, memo
Avoid Inline Objects in renderItem
Don't create new objects inside renderItem to pass as props. Inline objects
create new references on every render, breaking memoization. Pass primitive
values directly from item instead.
Incorrect (inline object breaks memoization):
Incorrect (inline style object):
Correct (pass item directly or primitives):
Correct (pass primitives, derive inside child):
Correct (hoist static styles in module scope):
Passing primitives or stable references allows memo() to skip re-renders when
the actual values haven't changed.
Note: If you have the React Compiler enabled, it handles memoization automatically and these manual optimizations become less critical.