Home › React Native / Expo › React Native + Expo Windsurf rules

React Native + Expo Windsurf rules

Windsurf rules for React Native apps on Expo SDK (New Architecture): Expo Router, native modules, and EAS builds.

WindsurfReact Native / Expo

How to use

Save this as .windsurf/rules/react-native.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

.windsurf/rules/react-native.mdDownload  
---
trigger: glob
globs: app/**,src/**,components/**
---

# React Native + Expo

- Use Expo Router file routes in `app/` (`_layout.tsx`, `(tabs)/`, `[id].tsx`); navigate with `<Link href>` / `router.push` and typed routes.
- Add native libraries with `npx expo install <pkg>` so versions match the SDK. Prefer Expo modules (`expo-image`, `expo-secure-store`, `expo-notifications`).
- The New Architecture is on; avoid libraries that don't support it.
- Lists: `FlatList`/`FlashList` with `keyExtractor` and memoized `renderItem`; never `ScrollView` + `map` for long lists.
- Styling with `StyleSheet.create` or the project's styling library; respect safe areas (`react-native-safe-area-context`).
- Images through `expo-image` with explicit sizes.
- Secrets/tokens in `expo-secure-store`, never `AsyncStorage`. Public config via `EXPO_PUBLIC_*` env only.
- Platform differences with `Platform.select` or `.ios.tsx`/`.android.tsx` files.
- Accessibility: `accessibilityLabel` and `accessibilityRole` on touchables; hit areas ≥ 44pt.
- Native config changes go in `app.config.ts` / config plugins, not edits to generated `ios/`/`android/` folders (CNG).

## Done when
`npx tsc --noEmit`, `npx expo lint`, and `npx jest` pass, and `npx expo-doctor` reports no issues.

More: all React Native / Expo rules · all Windsurf rules

Related rules

React Native + Expo rules

Cursor rules for Expo Router apps with TypeScript, NativeWind and TanStack Query.

CursorReact Native / Expo

.NET MAUI rules

Cursor rules for .NET MAUI apps on .NET 10: MVVM with CommunityToolkit.Mvvm, Shell navigation, compiled bindings, DI.

Cursor.NET MAUI

Flutter AGENTS.md

AGENTS.md for Flutter apps with Riverpod, go_router and clean feature-first structure.

AGENTS.mdFlutter

Flutter + Riverpod rules

Cursor rules for Flutter 3 apps using Riverpod 3 with code generation, go_router, and widget tests.

CursorFlutter

Ionic + Capacitor AGENTS.md

AGENTS.md for Ionic 8 apps with Capacitor (Angular, React, or Vue): native plugins, platform sync, and mobile UX rules.

AGENTS.mdIonic / Capacitor

Kotlin Multiplatform + Compose Multiplatform CLAUDE.md

CLAUDE.md for Kotlin Multiplatform apps sharing UI with Compose Multiplatform across Android, iOS, desktop, and web.

Claude Code (CLAUDE.md)Kotlin Multiplatform

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.