Skip to main content
rule

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.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/react-native-expo-cursorrules-prompt-file.mdc
Open on GitHub

What 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.mdc

Frontmatter: description, globs, alwaysApply

Step 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

Similar IDE rules

Everything for Mobile →

From the same set68

react This rule hands Cursor a set of React conventions: component structure, hooks, state, forms and accessibility. Useful when a project has plenty of .tsx and .jsx and you want one style. ★ 41,011repo stars react-typescript-nextjs-nodejs-cursorrules-prompt- A Cursor rule that pins down React, TypeScript, Next.js 14 and Node.js conventions: functional components, RORO, minimal use client. ★ 41,011repo stars react-styled-components-cursorrules-prompt-file A Cursor rule that tells the agent how to write React code with styled-components: functional components, theming through ThemeProvider, a fixed folder layout. ★ 41,011repo stars react-query-cursorrules-prompt-file A Cursor rule that tells the agent how to write React Query code: where QueryClient lives, how hooks and query keys are named. ★ 41,011repo stars rails-cursorrules-prompt-file A Cursor rule file that tells the agent how to write Rails 8 code: generators, bin/dev, the Solid stack, Minitest and Hotwire. ★ 41,011repo stars qwik-basic-cursorrules-prompt-file A Cursor rule that sets Qwik conventions for the agent: lazy functions with the $ suffix, signals, tasks, and a TypeScript plus Vite project layout. ★ 41,011repo stars python A Cursor rule that sets project layout, code style and stack choices for Python work with Flask and SQLite. Useful when the agent edits files in your repo. ★ 41,011repo stars python-github-setup-cursorrules-prompt-file Tells Cursor how to write and review Python code: style, tests, GitHub Pull Requests and GitHub Actions CI. Useful when the team has no shared rulebook. ★ 41,011repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor