TypeScript · React Native · Expo

React Native (Expo) rules for Cursor

Expo Router, dependency and native config rules for Expo apps.

The rule

Save as .cursor/rules/react-native-expo.mdc. Cursor picks it up on the next request.

.cursor/rules/react-native-expo.mdc

---
description: Expo and React Native conventions
globs: app/**/*.tsx, app/**/*.ts, src/**/*.tsx, src/**/*.ts, components/**/*.tsx, app.json, app.config.ts
alwaysApply: false
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.

How Cursor loads this rule

Read from the frontmatter above, per Cursor's rules documentation.

  • alwaysApply: false with globs: app/**/*.tsx, app/**/*.ts, src/**/*.tsx, src/**/*.ts, components/**/*.tsx, app.json, app.config.ts: attached automatically when a matching file is in context.
  • Keep the .mdc extension. A plain .md file in .cursor/rules is ignored by the rules system.
  • Prefer to generate your own? Type /create-rule in Agent and describe what you want; Cursor saves the file to .cursor/rules.
  • Team Rules come first, then Project Rules like this one, then User Rules. Earlier sources win when guidance conflicts.

Cursor rules setup guideCursor Team RulesLet Cursor run commands without asking

React Native (Expo) rules for Claude Code, Copilot, Kiro and other agents

The same instructions work as plain Markdown in AGENTS.md, which Codex, Gemini CLI, GitHub Copilot and most other coding agents read.

AGENTS.md (section)

## React Native (Expo)

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for Claude Code.claude/rules/react-native-expo.md

.claude/rules/react-native-expo.md

---
paths:
  - "app/**/*.tsx"
  - "app/**/*.ts"
  - "src/**/*.tsx"
  - "src/**/*.ts"
  - "components/**/*.tsx"
  - "app.json"
  - "app.config.ts"
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for GitHub Copilot.github/instructions/react-native-expo.instructions.md

.github/instructions/react-native-expo.instructions.md

---
applyTo: "app/**/*.tsx,app/**/*.ts,src/**/*.tsx,src/**/*.ts,components/**/*.tsx,app.json,app.config.ts"
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for Kiro.kiro/steering/react-native-expo.md

.kiro/steering/react-native-expo.md

---
inclusion: fileMatch
fileMatchPattern: ["app/**/*.tsx", "app/**/*.ts", "src/**/*.tsx", "src/**/*.ts", "components/**/*.tsx", "app.json", "app.config.ts"]
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for Antigravity.agents/rules/react-native-expo.md

.agents/rules/react-native-expo.md

---
trigger: glob
globs: "app/**/*.tsx, app/**/*.ts, src/**/*.tsx, src/**/*.ts, components/**/*.tsx, app.json, app.config.ts"
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for Devin Desktop (Windsurf).devin/rules/react-native-expo.md

.devin/rules/react-native-expo.md

---
trigger: glob
globs: app/**/*.tsx, app/**/*.ts, src/**/*.tsx, src/**/*.ts, components/**/*.tsx, app.json, app.config.ts
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for Cline.clinerules/react-native-expo.md

.clinerules/react-native-expo.md

---
paths:
  - "app/**/*.tsx"
  - "app/**/*.ts"
  - "src/**/*.tsx"
  - "src/**/*.ts"
  - "components/**/*.tsx"
  - "app.json"
  - "app.config.ts"
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.
React Native (Expo) rules for Continue.continue/rules/react-native-expo.md

.continue/rules/react-native-expo.md

---
name: "react-native-expo"
globs: ["app/**/*.tsx", "app/**/*.ts", "src/**/*.tsx", "src/**/*.ts", "components/**/*.tsx", "app.json", "app.config.ts"]
---

- Use Expo Router file-based routes in the app directory, with _layout.tsx for stacks and tabs. Do not set up a separate navigation container.
- Import navigation APIs (Link, Stack, Tabs, useRouter, useLocalSearchParams) from expo-router, not @react-navigation/*.
- Install packages with npx expo install so versions match the SDK.
- Change native configuration in app.json or app.config.ts and config plugins, not by editing generated ios/ and android/ folders.
- Use components from react-native, not web elements like div or span; all text goes inside <Text>.
- Use Pressable for touch targets and FlatList (or the project's list library) for long lists, not ScrollView with map.
- Handle safe areas with react-native-safe-area-context.
- EXPO_PUBLIC_ variables are bundled into the app; never put secrets in them. Store tokens with expo-secure-store, not AsyncStorage.
- Run npx expo-doctor and the type checker before finishing.

Edit this rule and convert it for 11 agents →

More templates

Get Cursor rules and settings changes by email

When Cursor changes how rules, run modes or settings work, we update these templates from the docs and send a short note. One email a week at most.

Reviewed Oct 20, 2026. Written by AgentAtlas. Adapt it to your codebase before relying on it.