Skip to main content
skill CX Codex

react-native-patterns — Claude Code skill

This skill guides an agent building React Native and Expo apps, covering navigation, platform-specific code, styling, lists, and native modules.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add spencerpauly/awesome-cursor-skills --skill react-native-patterns -a claude-code
Open on GitHub

What react-native-patterns does

The skill gives an agent working patterns for React Native and Expo projects. It covers file-based navigation with expo-router, iOS and Android code differences, StyleSheet.create, and long lists built with FlatList.

It includes an app/_layout.tsx route structure with tabs and dynamic routes. It also points to @react-navigation/native, nativewind, zustand, @tanstack/react-query, and expo-image for distinct implementation needs.

Expo is recommended for most projects. Choose Bare React Native when a custom native module is not supported by Expo, because it gives full native control.

What it helps with

  • Set up file-based routes with expo-router
  • Split code between iOS and Android
  • Render a long list with FlatList
  • Avoid styles recreated on every render
  • Store sensitive data with expo-secure-store

Example prompts for the agent

  • Use react-native-patterns to create tab navigation with expo-router.
  • Apply react-native-patterns and split the component into Component.ios.tsx and Component.android.tsx.
  • Use react-native-patterns to replace this long ScrollView with FlatList.

How to install react-native-patterns

1Skills CLI (Vercel)

npx skills add spencerpauly/awesome-cursor-skills --skill react-native-patterns -a claude-code

2Manually: put the files in place

~/.claude/skills/react-native-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/react-native-patterns/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about react-native-patterns

How do I install react-native-patterns in Claude Code?

Run npx skills add spencerpauly/awesome-cursor-skills --skill react-native-patterns -a claude-code, then run npx skills add spencerpauly/awesome-cursor-skills --skill react-native-patterns -a claude-code again.

What does react-native-patterns do?

The skill gives an agent React Native and Expo guidance for mobile app work. It covers navigation, styling, performance, platform-specific code, and native modules.

When should I use Expo instead of Bare React Native?

Expo is recommended for most projects. Use Bare React Native when you need a custom native module that Expo does not support.

Source text

SKILL.md · CC0-1.0
---
name: react-native-patterns
description: Build mobile apps with React Native and Expo — navigation, platform-specific code, performance, and native modules.
user-invocable: true
---

# React Native Patterns

Build production-quality mobile apps with React Native and Expo.

## Project Setup

**Expo (recommended for most projects):**
```bash
npx create-expo-app@latest my-app
cd my-app
npx expo start
```

**Bare React Native (when you need full native control):**
```bash
npx @react-native-community/cli init MyApp
```

Use Expo unless you need a custom native module that Expo doesn't support.

## Navigation

Use `expo-router` (file-based routing) or `@react-navigation/native`:

```
app/
├── _layout.tsx        # Root layout (tabs, stack, drawer)
├── index.tsx          # Home screen
├── (tabs)/
│   ├── _layout.tsx    # Tab navigator
│   ├── home.tsx
│   ├── profile.tsx
│   └── settings.tsx
└── [id].tsx           # Dynamic route
```

## Platform-Specific Code

```typescript
import { Platform } from 'react-native';

const styles = StyleSheet.create({
  shadow: Platform.select({
    ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1 },
    android: { elevation: 4 },
  }),
});
```

For larger differences, use platform-specific files:
- `Component.ios.tsx`
- `Component.android.tsx`

## Styling

Use `StyleSheet.create` for performance (styles are sent to native once):

```typescript
const styles = StyleSheet.create({
  container: { flex: 1, padding: 16 },
  title: { fontSize: 24, fontWeight: '700' },
});
```

For a Tailwind-like experience, use `nativewind`:
```tsx
<View className="flex-1 p-4">
  <Text className="text-2xl font-bold">Hello</Text>
</View>
```

## Performance

**FlatList over ScrollView** for long lists:
```tsx
<FlatList
  data={items}
  keyExtractor={(item) => item.id}
  renderItem={({ item }) => <ItemRow item={item} />}
  initialNumToRender={10}
  maxToRenderPerBatch={5}
  windowSize={5}
/>
```

**Memoize expensive components:**
```tsx
const ItemRow = React.memo(({ item }: { item: Item }) => (
  <View><Text>{item.name}</Text></View>
));
```

**Avoid:**
- Inline styles (creates new objects every render)
- Anonymous functions in `renderItem`
- Large images without caching (`expo-image` handles this)

## Common Libraries

| Need | Library |
|------|---------|
| Navigation | `expo-router` or `@react-navigation/native` |
| State | `zustand`, `jotai`, or React context |
| Data fetching | `@tanstack/react-query` |
| Images | `expo-image` |
| Icons | `@expo/vector-icons` |
| Storage | `expo-secure-store` (sensitive), `@react-native-async-storage/async-storage` (general) |
| Animations | `react-native-reanimated` |
| Gestures | `react-native-gesture-handler` |
| Forms | `react-hook-form` + `zod` |

## Tips

- Test on both iOS and Android from the start, not at the end
- Use `expo-dev-client` for custom native modules with Expo
- Handle safe areas with `react-native-safe-area-context`
- Always handle keyboard avoidance for forms (`KeyboardAvoidingView`)
- Use `expo-updates` for OTA updates in production

© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills

Similar skills

Everything for Mobile →

From the same set59

exporting-to-png Teaches the agent to render code snippets, Mermaid diagrams, terminal logs, and SVG files into PNG images via CLI utilities or headless browsers. CX Codex +1 401installs parallel-ci-triage Splits failed GitHub Actions jobs across parallel subagents, each fixing its own slice. Useful when CI breaks in several places at once. CX Codex +1 403installs screenshotting-changelog Builds a visual changelog for a pull request: captures pages before and after your UI edits and drops the image pairs into the PR body. CX Codex +1 401installs updating-npm-package Updates npm dependencies safely by checking npmjs.com and adapting to the version jump. It runs tests on minor updates and finds migration guides for major ones. CX Codex +1 398installs adding-docker This skill writes a Dockerfile, docker-compose setup and .dockerignore for your app. Useful when you want a container without hand-writing the configs. CX Codex +1 398installs fixing-broken-links This skill scans project files for dead URLs and broken local paths, verifies responses with curl, and repairs or removes missing links. CX Codex +1 393installs converting-css-modules-to-tailwind Moves one component off CSS Modules and onto Tailwind utility classes, then removes the module file and its import. CX Codex +1 392installs generating-images This skill generates and edits images through the OpenAI Image API on gpt-image-2. Handy when you need an OG banner, an icon or a mockup without leaving the agent chat. CX Codex +1 388installs

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