React Native & Expo Router Mobile App Production (.cursorrules)
Stops Cursor from generating legacy class components, obsolete React Navigation boilerplate, or memory-leaking animation loops on iOS and Android.
Parametric Customizer & Compiler Live Tool
Adjust the variables below. The prompt code and API payload update dynamically in real time.
Directs Cursor on how to structure component styles.
Chooses high-speed storage engines that avoid thread blocking.
# CURSOR RULES FOR REACT NATIVE & EXPO (NEW ARCHITECTURE) You are a Principal Mobile Architect specialized in React Native, Expo Router, TypeScript, and NativeWind v4. ### TECH STACK REQUIREMENTS: - Framework: Expo with Expo Router (file-based navigation under `/app`) - Architecture: React Native New Architecture (Bridgeless + TurboModules enabled) - Styling: NativeWind v4 (Tailwind CSS for React Native with compile-time CSS) - Animations: React Native Reanimated 3 (worklet-driven UI thread animations) - State & Storage: Zustand with react-native-mmkv (100x faster synchronous key-value storage) - Gestures: react-native-gesture-handler ### CRITICAL MOBILE CONSTRAINTS: 1. **Performance & 120Hz Fluidity**: - NEVER trigger state updates inside 60/120fps gesture loops. Use `useSharedValue` and `useAnimatedStyle`. - Use `@shopify/flash-list` instead of standard `FlatList` for long scrollable lists. - Always specify `contentContainerStyle` for scrollable views, avoiding nested unconstrained ScrollViews. 2. **Platform Parity (iOS vs Android)**: - Enforce safe area handling via `react-native-safe-area-context`. - Account for Android hardware back button and navigation bars. - Never use Web-only APIs (e.g. `window.localStorage`, `document.querySelector`). 3. **Navigation & Deep Linking**: - Use typed routes with Expo Router's `useRouter()` and `<Link href="..." />`. - Modularize reusable components into `/components` and custom hooks into `/hooks`.
Code React Native apps with multi-file refactoring and lightning intelligence.
Leonardo Phoenix & Flux: Generate photorealistic studio assets with 150 daily free credits. Zero setup required.
πΈ Real Sample Outputs & Verified Results
Visual evidence and benchmark responses generated using this exact prompt formula.
π¬ Prompt Engineering Anatomy
Why this prompt consistently delivers high-tier results: technical parameter breakdown.
Enforced @shopify/flash-list over FlatList Standard FlatList creates massive bridge traffic and blank white tiles during rapid scrolling. FlashList recycles views for seamless 120fps scrolling.
react-native-mmkv synchronous storage directive Standard AsyncStorage is asynchronous and adds perceptible delay to initial app launch. MMKV operates synchronously via C++ JSI.
π¬ Frequently Asked Questions
Troubleshooting common edge cases, model incompatibilities, and best practices.
Can I use this with Expo Go?
Yes, unless you use native C++ libraries that require Expo Prebuild / Development Builds.
Does this work in Windsurf or Copilot?
Yes! Works across all AI code editors supporting custom instruction rules.
Explore Related AI Coding & Rulesets Prompts View all β
DeepSeek R1 Architecture & Security Vulnerability Code Auditor
Engineered specifically for DeepSeek R1 and reasoning models. Directs the thinking tokens (<think>) to rigorously stress-test edge cases before proposing optimized refactors.
cursorCursor AI (.cursorrules) for Next.js 15, React 19 & Tailwind CSS
Stops Cursor from writing outdated Next.js 13 patterns, Pages Router syntax, or deprecated React hooks. Enforces strict TypeScript, Server Actions, and modular clean architecture.
cursorFastAPI, PostgreSQL & Supabase Production (.cursorrules)
Eliminates common Python AI code generation traps: synchronous database calls in async routes, outdated Pydantic v1 syntax, and missing transaction rollbacks.