Skip to content
cccskills
FreePublished on GitHub

react-native-patterns

Build mobile apps with React Native and Expo — navigation, platform-specific code, performance, and native modules.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

React Native Patterns

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

Project Setup

Expo (recommended for most projects):

npx create-expo-app@latest my-app
cd my-app
npx expo start

Bare React Native (when you need full native control):

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

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):

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

For a Tailwind-like experience, use nativewind:

<View className="flex-1 p-4">
  <Text className="text-2xl font-bold">Hello</Text>
</View>

Performance

FlatList over ScrollView for long lists:

<FlatList
  data={items}
  keyExtractor={(item) => item.id}
  renderItem={({ item }) => <ItemRow item={item} />}
  initialNumToRender={10}
  maxToRenderPerBatch={5}
  windowSize={5}
/>

Memoize expensive components:

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

NeedLibrary
Navigationexpo-router or @react-navigation/native
Statezustand, jotai, or React context
Data fetching@tanstack/react-query
Imagesexpo-image
Icons@expo/vector-icons
Storageexpo-secure-store (sensitive), @react-native-async-storage/async-storage (general)
Animationsreact-native-reanimated
Gesturesreact-native-gesture-handler
Formsreact-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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use Cursor's browser aria snapshots to audit a page for accessibility issues — missing labels, broken tab order, contrast, and ARIA misuse.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Add PostHog analytics to a web application, including event tracking, page views, feature flags, and session replay.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Generate OpenAPI/Swagger documentation for an API, including endpoint schemas, request/response types, and interactive docs UI.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Add authentication to a web application using NextAuth.js (Auth.js), including OAuth providers, session management, and protected routes.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Dockerize an application with a production-ready Dockerfile, docker-compose setup, and .dockerignore.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Set up Playwright end-to-end testing in a project, including test configuration, example tests, and CI integration.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

See all skills by 0xAidan

Report a problem with this skill