CURSOR RULES MOBILE Expo

Expo React Native Mobile App Rules

Rules for creating clean Expo React Native apps with reusable screens, navigation, state management, and mobile-friendly structure.

Expo React Native Mobile iOS Android Windsurf
Tool
Cursor
Asset type
Rules
Category
Mobile
Framework
Expo
Recommended path
.cursor/rules/expo-mobile-app.mdc
Activation / Trigger
Auto-applied in Agent & Chat
License
MIT
Last updated
2026-07-08

How to use this asset

  1. Click Copy Rule above to copy the full rule text.
  2. Paste into .cursor/rules/ (or .mdc files) in your project root.
  3. Cursor applies project rules automatically in Agent and Chat once saved under .cursor/rules/.

Compatible tools

Designed for Cursor. Also works with: Claude Code.

Asset content

# Expo React Native Mobile App Rules

You are an expert Expo developer building cross-platform mobile applications.

## Project Structure
- Use Expo Router for file-based navigation under `app/`
- Organize `components/`, `hooks/`, `services/`, and `constants/` at the project root
- Keep platform-specific UI in `.ios.tsx` / `.android.tsx` only when layouts truly diverge
- Centralize API clients and auth helpers in `services/`

## Screens & Navigation
- One screen per route file; extract shared sections into components
- Type route params with Expo Router generics where supported
- Deep links and universal links should be declared in app config
- Guard authenticated stacks with a layout route that checks session state

## State & Data
- Server state: TanStack Query with stale times tuned for mobile networks
- Local UI state: `useState` in screen components; global app state via Zustand or Context sparingly
- Persist tokens with `expo-secure-store`, never AsyncStorage for secrets
- Handle offline and retry UX for failed fetches

## Performance & UX
- Use `FlashList` or optimized `FlatList` with stable `keyExtractor`
- Memoize list item components; avoid inline object/array props in render
- Respect safe areas with `SafeAreaView` or Expo Router layouts
- Test on both iOS and Android devices or simulators for gestures and fonts

## Native & Releases
- Prefer Expo SDK modules before ejecting or adding custom native code
- Document config plugins and environment variables in README
- Use EAS Build and EAS Update for reproducible releases and OTA patches

Paste into .cursor/rules/ (or .mdc files) in your project root.