react-native-expo-cursorrules-prompt-file — Cursor rule: what it
A Cursor rule that tells the agent how to write React Native code with Expo. Useful when you want new screens and components to follow one stack.
.cursor/rules/react-native-expo-cursorrules-prompt-file.mdcWhat react-native-expo-cursorrules-prompt-file does
The rule spells out how the agent should write code in a React Native project built on Expo. It lists practices: functional components with hooks, Expo SDK features, navigation through Expo Router, Expo's asset system for images and fonts, error handling and crash reporting, push notifications.
A folder layout comes next: assets/, src/ with components/, screens/, navigation/, hooks/, utils/, plus App.js and app.json at the root. Seven more instructions cover TypeScript, styling with StyleSheet, vector icons, secure store for sensitive data, offline support, performance, and OTA updates.
You drop the rule at .cursor/rules/react-native-expo-cursorrules-prompt-file.mdc. It ships with alwaysApply: false and globs: **/*, so it does not fire on every file by itself — you enable it or point the agent at it in a prompt. On a project that is not on Expo, the SDK, Router and OTA lines will just mislead the agent.
What it helps with
- pin one React Native and Expo stack for the agent
- lock the folder layout before writing screens
- get Expo Router navigation without repeating yourself
- keep TypeScript and StyleSheet in every new component
- store tokens and keys through secure store
Example prompts for the agent
- Create a profile screen in
src/screens/following the React Native Expo rules - Set up navigation with Expo Router and add Expo vector icons
- Rewrite this component as a functional component with hooks and StyleSheet
How to install react-native-expo-cursorrules-prompt-file
Manually: put the files in place
.cursor/rules/react-native-expo-cursorrules-prompt-file.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/react-native-expo-cursorrules-prompt-file.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/react-native-expo-cursorrules-prompt-file.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/react-native-expo-cursorrules-prompt-file.mdManually: put the files in place
.clinerules/react-native-expo-cursorrules-prompt-file.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about react-native-expo-cursorrules-prompt-file
How do I install react-native-expo-cursorrules-prompt-file in Cursor?
Place the file at .cursor/rules/react-native-expo-cursorrules-prompt-file.mdc in your project root. Cursor picks it up as a rule.
What does react-native-expo-cursorrules-prompt-file do?
It gives the agent React Native with Expo practices: hooks, Expo SDK, Expo Router, assets, error handling, push notifications. It also sets the folder structure and rules for TypeScript, styling and secure store.
Does the rule apply to every file automatically?
No. It sets alwaysApply: false, with globs: **/* defining the scope. Turn it on yourself or reference it in a prompt.
Source text
react-native-expo-cursorrules-prompt-file.mdc · CC0-1.0
--- description: "Cursor rules for React Native Expo development." globs: **/* alwaysApply: false --- // React Native Expo .cursorrules // React Native Expo best practices const reactNativeExpoBestPractices = [ "Use functional components with hooks", "Utilize Expo SDK features and APIs", "Implement proper navigation using Expo Router", "Use Expo's asset system for images and fonts", "Implement proper error handling and crash reporting", "Utilize Expo's push notification system", ]; // Folder structure const folderStructure = ` assets/ src/ components/ screens/ navigation/ hooks/ utils/ App.js app.json `; // Additional instructions const additionalInstructions = ` 1. Use TypeScript for type safety 2. Implement proper styling using StyleSheet 3. Utilize Expo's vector icons 4. Use Expo's secure store for sensitive data 5. Implement proper offline support 6. Follow React Native best practices for performance 7. Use Expo's OTA updates for quick deployments `;
© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules