Skip to main content
skill CX Codex

react-native · jezweb — Claude Code skill: what it does, how to install

Performance guidelines and architecture patterns for React Native and Expo apps. Helps coding agents handle list virtualization, UI-thread animations, and navigation.

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

What react-native does

The skill provides mobile architecture rules ranked by severity. Critical issues must be fixed before medium-priority tasks. List rendering causes the most problems. Because of this, the rules enforce <FlatList> or @shopify/flash-list alongside keyExtractor and getItemLayout instead of bare <ScrollView>.

For animations, the skill keeps execution on the UI thread. Complex motion moves to react-native-reanimated, while gestures rely on react-native-gesture-handler. Navigation follows the expo-router file structure, and media handling points to expo-image.

These patterns prevent dropped frames, but they require adding specialized Expo and community libraries instead of default React Native modules.

What it helps with

  • eliminate frame drops during large list scrolling
  • move complex animations from the JavaScript thread to the UI thread
  • scaffold file-based navigation layouts with Expo Router
  • prevent layout overlaps around device notches and soft keyboards

Example prompts for the agent

  • Review this FlatList implementation and optimize its render performance
  • Implement a draggable card animation using react-native-reanimated
  • Set up an Expo Router file structure with dynamic routes and tabs

How to install react-native

1Skills CLI (Vercel)

npx skills add jezweb/claude-skills --skill react-native -a claude-code

2Manually: put the files in place

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

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

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

Questions about react-native

How to install react-native in Claude Code?

Run npx skills add jezweb/claude-skills --skill react-native -a claude-code. Alternatively, place the file directly at ~/.claude/skills/react-native/SKILL.md.

What does the react-native skill do?

It equips coding agents with mobile performance patterns for React Native and Expo. The agent actively corrects list jank, off-screen rendering, thread blocking, and safe area handling.

What list optimizations does this skill enforce?

It replaces ScrollView with virtualized lists, mandates stable keys, and applies getItemLayout for fixed-height items. For large datasets, it recommends @shopify/flash-list.

Source text

SKILL.md · MIT
---
name: react-native
description: "React Native and Expo patterns for building performant mobile apps. Covers list performance, animations with Reanimated, navigation, UI patterns, state management, platform-specific code, and Expo workflows. Use when building or reviewing React Native code. Triggers: 'react native', 'expo', 'mobile app', 'react native performance', 'flatlist', 'reanimated', 'expo router', 'mobile development', 'ios app', 'android app'."
compatibility: claude-code-only
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - Bash
---

# React Native Patterns

Performance and architecture patterns for React Native + Expo apps. Rules ranked by impact — fix CRITICAL before touching MEDIUM.

This is a starting point. The skill will grow as you build more mobile apps.

## When to Apply

- Building new React Native or Expo apps
- Optimising list and scroll performance
- Implementing animations
- Reviewing mobile code for performance issues
- Setting up a new Expo project

## 1. List Performance (CRITICAL)

Lists are the #1 performance issue in React Native. A janky scroll kills the entire app experience.

| Pattern | Problem | Fix |
|---------|---------|-----|
| **ScrollView for data** | `<ScrollView>` renders all items at once | Use `<FlatList>` or `<FlashList>` — virtualised, only renders visible items |
| **Missing keyExtractor** | FlatList without `keyExtractor` → unnecessary re-renders | `keyExtractor={(item) => item.id}` — stable unique key per item |
| **Complex renderItem** | Expensive component in renderItem re-renders on every scroll | Wrap in `React.memo`, extract to separate component |
| **Inline functions in renderItem** | `renderItem={({ item }) => <Row onPress={() => nav(item.id)} />}` | Extract handler: `const handlePress = useCallback(...)` |
| **No getItemLayout** | FlatList measures every item on scroll (expensive) | Provide `getItemLayout` for fixed-height items: `(data, index) => ({ length: 80, offset: 80 * index, index })` |
| **FlashList** | FlatList is good, FlashList is better for large lists | `@shopify/flash-list` — drop-in replacement, recycling architecture |
| **Large images in lists** | Full-res images decoded on main thread | Use `expo-image` with placeholder + transition, specify dimensions |

### FlatList Checklist

Every FlatList should have:
```tsx
<FlatList
  data={items}
  keyExtractor={(item) => item.id}
  renderItem={renderItem}           // Memoised component
  getItemLayout={getItemLayout}     // If items are fixed height
  initialNumToRender={10}           // Don't render 100 items on mount
  maxToRenderPerBatch={10}          // Batch size for off-screen rendering
  windowSize={5}                    // How many screens to keep in memory
  removeClippedSubviews={true}      // Unmount off-screen items (Android)
/>
```

## 2. Animations (HIGH)

Native animations run on the UI thread. JS animations block the JS thread and cause jank.

| Pattern | Problem | Fix |
|---------|---------|-----|
| **Animated API for complex animations** | `Animated` runs on JS thread, blocks interactions | Use `react-native-reanimated` — runs on UI thread |
| **Layout animation** | Item appears/disappears with no transition | `LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)` |
| **Shared element transitions** | Navigate between screens, element teleports | `react-native-reanimated` shared transitions or `expo-router` shared elements |
| **Gesture + animation** | Drag/swipe feels laggy | `react-native-gesture-handler` + `reanimated` worklets — all on UI thread |
| **Measuring layout** | `onLayout` fires too late, causes flash | Use `useAnimatedStyle` with shared values for instant response |

### Reanimated Basics

```tsx
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';

function AnimatedBox() {
  const offset = useSharedValue(0);
  const style = useAnimatedStyle(() => ({
    transform: [{ translateX: withSpring(offset.value) }],
  }));

  return (
    <GestureDetector gesture={panGesture}>
      <Animated.View style={[styles.box, style]} />
    </GestureDetector>
  );
}
```

## 3. Navigation (HIGH)

| Pattern | Problem | Fix |
|---------|---------|-----|
| **Expo Router** | File-based routing (like Next.js) for React Native | `app/` directory with `_layout.tsx` files. Preferred for new Expo projects. |
| **Heavy screens on stack** | Every screen stays mounted in the stack | Use `unmountOnBlur: true` for screens that don't need to persist |
| **Deep linking** | App doesn't respond to URLs | Expo Router handles this automatically. For bare RN: `Linking` API config |
| **Tab badge updates** | Badge count doesn't update when tab is focused | Use `useIsFocused()` or refetch on focus: `useFocusEffect(useCallback(...))` |
| **Navigation state persistence** | App loses position on background/kill | `onStateChange` + `initialState` with AsyncStorage |

### Expo Router Structure

```
app/
├── _layout.tsx          # Root layout (tab navigator)
├── index.tsx            # Home tab
├── (tabs)/
│   ├── _layout.tsx      # Tab bar config
│   ├── home.tsx
│   ├── search.tsx
│   └── profile.tsx
├── [id].tsx             # Dynamic route
└── modal.tsx            # Modal route
```

## 4. UI Patterns (HIGH)

| Pattern | Problem | Fix |
|---------|---------|-----|
| **Safe area** | Content under notch or home indicator | `<SafeAreaView>` or `useSafeAreaInsets()` from `react-native-safe-area-context` |
| **Keyboard avoidance** | Form fields hidden behind keyboard | `<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'}>` |
| **Platform-specific code** | iOS and Android need different behaviour | `Platform.select({ ios: ..., android: ... })` or `.ios.tsx` / `.android.tsx` files |
| **Status bar** | Status bar overlaps content or wrong colour | `<StatusBar style="auto" />` from `expo-status-bar` in root layout |
| **Touch targets** | Buttons too small to tap | Minimum 44x44pt. Use `hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}` |
| **Haptic feedback** | Taps feel dead | `expo-haptics` — `Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)` on important actions |

## 5. Images and Media (MEDIUM)

| Pattern | Problem | Fix |
|---------|---------|-----|
| **Image component** | `<Image>` from react-native is basic | Use `expo-image` — caching, placeholder, transition, blurhash |
| **Remote images without dimensions** | Layout shift when image loads | Always specify `width` and `height`, or use `aspectRatio` |
| **Large images** | OOM crashes on Android | Resize server-side or use `expo-image` which handles memory |
| **SVG** | SVG support isn't native | `react-native-svg` + `react-native-svg-transformer` for SVG imports |
| **Video** | Video playback | `expo-av` or `expo-video` (newer API) |

## 6. State and Data (MEDIUM)

| Pattern | Problem | Fix |
|---------|---------|-----|
| **AsyncStorage for complex data** | JSON parse/stringify on every read | Use MMKV (`react-native-mmkv`) — 30x faster than AsyncStorage |
| **Global state** | Redux/MobX boilerplate for simple state | Zustand — minimal, works great with React Native |
| **Server state** | Manual fetch + loading + error + cache | TanStack Query — same as web, works in React Native |
| **Offline first** | App unusable without network | TanStack Query `persistQueryClient` + MMKV, or WatermelonDB for complex offline |
| **Deep state updates** | Spread operator hell for nested objects | Immer via Zustand: `set(produce(state => { state.user.name = 'new' }))` |

## 7. Expo Workflow (MEDIUM)

| Pattern | When | How |
|---------|------|-----|
| **Development build** | Need native modules | `npx expo run:ios` or `eas build --profile development` |
| **Expo Go** | Quick prototyping, no native modules | `npx expo start` — scan QR code |
| **EAS Build** | CI/CD, app store builds | `eas build --platform ios --profile production` |
| **EAS Update** | Hot fix without app store review | `eas update --branch production --message "Fix bug"` |
| **Config plugins** | Modify native config without ejecting | `app.config.ts` with `expo-build-properties` or custom config plugin |
| **Environment variables** | Different configs per build | `eas.json` build profiles + `expo-constants` |

### New Project Setup

```bash
npx create-expo-app my-app --template tabs
cd my-app
npx expo install expo-image react-native-reanimated react-native-gesture-handler react-native-safe-area-context
```

## 8. Testing (LOW-MEDIUM)

| Tool | For | Setup |
|------|-----|-------|
| **Jest** | Unit tests, hook tests | Included with Expo by default |
| **React Native Testing Library** | Component tests | `@testing-library/react-native` |
| **Detox** | E2E tests on real devices/simulators | `detox` — Wix's testing framework |
| **Maestro** | E2E with YAML flows | `maestro test flow.yaml` — simpler than Detox |

## Common Gotchas

| Gotcha | Fix |
|--------|-----|
| Metro bundler cache | `npx expo start --clear` |
| Pod install issues (iOS) | `cd ios && pod install --repo-update` |
| Reanimated not working | Must be first import: `import 'react-native-reanimated'` in root |
| Expo SDK upgrade | `npx expo install --fix` after updating SDK version |
| Android build fails | Check `gradle.properties` for memory: `org.gradle.jvmargs=-Xmx4g` |
| iOS simulator slow | Use physical device for performance testing — simulator doesn't reflect real perf |

© jezweb · MIT · jezweb/claude-skills

Similar skills

Everything for Mobile →

react-native by other authors comes first.

react-native vercel-labs This skill turns JSON specs into native React Native mobile UIs. Use it when screens need state bindings, conditional visibility, and actions. CX Codex +1 3,200installs react-native alinaqi A skill that sets project structure, component patterns and testing rules for React Native. Kicks in when the agent touches .tsx files or iOS and Android code. CX Codex +1 566installs react-native assistant-ui A skill for building assistant-ui chat surfaces in Expo and bare React Native: native primitives, the AI SDK runtime and a transport to your backend. CX Codex +1 909installs react-native-dev MiniMax-AI A React Native and Expo reference set for your agent: routing, lists, animation, state, tests and shipping. Useful when you are building a mobile app and don't want to re-explain the basics. CX Codex +1 1,900installs react-native-design Seth Hobson This skill guides React Native styling, navigation, and Reanimated animations. Use it when building cross-platform mobile apps or platform-specific screens. CX Codex 15,522installs react-native-ease-refactor appandflow Scans Animated and react-native-reanimated code, then moves eligible components to EaseView. Use it when adopting react-native-ease. CX Codex +1 937installs expo-react-native-performance pproenca Performance guidelines with 42 prioritized rules for Expo React Native apps. Helps agents refactor startup bottlenecks, list virtualization, re-renders, and animations. CX Codex +1 1,500installs vercel-react-native-skills vercel A rules pack for React Native and Expo work: lists, animations, navigation, native modules. Load it so your agent makes mobile changes the same way every time. CX Codex +1 255,200installs react-native-architecture Seth Hobson A skill for Claude Code, Codex and Cursor that hands your agent project layout, navigation, native modules and offline sync patterns for React Native on Expo. CX Codex 15,087installs

From the same set60

mcp-builder A skill that takes a short brief and turns it into a deployable MCP server on Python with FastMCP, complete with local tests and a pre-deploy checklist. CX Codex +1 1,400installs cloudflare-worker-builder Scaffolds Cloudflare Worker projects with Hono routing, Vite dev server, and Static Assets. It configures D1, R2, and KV bindings and fixes deployment routing conflicts. CX Codex +1 1,400installs design-review Reviews the visual quality of a web page or app and produces a findings report with screenshots. Use it when an interface looks off and the cause is hard to spot. CX Codex +1 1,400installs react-patterns A skill that checks React 19 components for waterfalls, bundle bloat and re-renders, and suggests composition fixes. Useful while writing or reviewing code. CX Codex +1 1,300installs github-release Prepares a GitHub release by checking code for public publishing, creating a tag, and publishing through gh. Use it before making a repository public. CX Codex +1 1,300installs d1-migration Walks Cloudflare D1 migrations through Drizzle: generate the SQL, read it for traps, apply to local and remote, unstick partial runs. CX Codex +1 1,200installs deep-research Does the digging before you write code: scans your own projects, rivals, forums and libraries, then hands back a research brief. CX Codex +1 1,200installs proposal-writer Drafts client proposals, scopes of work, and quotes for service businesses. It helps web developers, agencies, and consultants close deals with structured terms. CX Codex +1 1,200installs

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