Home › React Native / Expo › React Native + Expo rules
React Native + Expo rules
Cursor rules for Expo Router apps with TypeScript, NativeWind and TanStack Query.
CursorReact Native / Expo
How to use
Save this as .cursor/rules/expo.mdc in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.
.cursor/rules/expo.mdcDownload ---
description: Expo / React Native conventions
globs: ["app/**/*.tsx", "src/**/*.{ts,tsx}"]
---
# Expo + React Native
- Expo SDK managed workflow; use Expo Router file-based routes in `app/`. Don't eject or add native modules without asking.
- Install packages with `npx expo install` so versions match the SDK.
- Functional components + hooks only. Styling with NativeWind classes; use `StyleSheet.create` only for dynamic/animated styles.
- Server state with TanStack Query; local UI state with `useState`/Zustand. No Redux.
- Lists: `FlashList` or `FlatList` with stable `keyExtractor`; never `.map()` long lists inside a `ScrollView`.
- Respect safe areas (`react-native-safe-area-context`) and test both iOS and Android behavior (keyboard, back button).
- Secrets never ship in the bundle; `EXPO_PUBLIC_*` vars are public.
- Accessibility: every touchable gets `accessibilityRole` and a label.