vercel-labs / agent-skills
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
- Use fallback state instead of initialState
- impact
- MEDIUM
- impactDescription
- reactive fallbacks without syncing
- tags
- state, hooks, derived-state, props, initialState
Use fallback state instead of initialState
Use undefined as initial state and nullish coalescing (??) to fall back to
parent or server values. State represents user intent only—undefined means
"user hasn't chosen yet." This enables reactive fallbacks that update when the
source changes, not just on initial render.
Incorrect (syncs state, loses reactivity):
Correct (state is user intent, reactive fallback):
With server data: