Programming·Updated May 10, 2026·18 min read·👁 11.8K views

React Native AI Prompts: Build Production iOS & Android Apps Faster in 2026

John Allick· AI Researcher
📖 2,664 words
Quick Summary

Complete AI prompt library for React Native developers. Covers Expo Router, navigation, authentication with biometrics, offline sync, push notifications, Reanimated animations, performance profiling, and App Store / Play Store deployment.

#React Native#Expo#iOS#Android#Mobile Development#AI Coding Prompts

React Native in 2026: One Codebase, Two Stores

React Native with Expo has become the dominant cross-platform mobile framework for JavaScript teams. The developers shipping the most polished React Native apps use AI prompts that specify Expo Router, Reanimated 3, and the new Architecture (Fabric + JSI) — not the legacy patterns that dominate Stack Overflow. These prompts produce code that runs smoothly on real devices, not just simulators.

Picking the Right AI Model for React Native + Expo Work

React Native's bridge to native APIs — and the relatively recent New Architecture (Fabric/JSI) — is where most AI models show their age. Expo SDK versions change fast, and models trained before SDK 50 generate patterns that are deprecated or broken.

ModelBest For (RN/Expo)Weak SpotWhen to Reach For It
Claude SonnetExpo Router architecture, complex navigation patterns, Reanimated 3 workletsOccasionally generates old-style React Navigation patterns instead of Expo RouterDesigning the navigation structure, reviewing gesture handler implementation, planning state management with Zustand + MMKV
ChatGPT GPT-5.5React Native component boilerplate, StyleSheet-based styling, basic screen componentsGenerates React Navigation instead of Expo Router; misses NativeWind syntaxGenerating screen components from a Figma description, writing StyleSheet-based UI components
Gemini 3.5 FlashExpo ecosystem research, SDK version compatibility, EAS Build configuration researchLess depth on Reanimated 3 and Gesture Handler specificsResearching Expo SDK 52 breaking changes, comparing EAS vs bare workflow
CursorCompleting React Native components aware of your existing component libraryNative module types can be incorrect without platform contextWriting components when it can see your existing screen and component patterns
GitHub CopilotStyleSheet completions, useEffect patterns for native event listenersGenerates bridge-based native module patterns even in New Architecture projectsCompleting StyleSheet objects, writing basic event handler patterns
GrokDirect comparison: React Native vs Flutter for your team's skills and requirementsLess depth on Expo-specific API patternsGetting an unhedged answer on whether React Native or Flutter is right for a specific project
DeepSeekTypeScript interface definitions, utility function generationPlatform-specific code and native API integrationGenerating TypeScript types for API responses, writing utility functions

The most important thing in every React Native prompt: "Expo SDK 52, Expo Router v4, New Architecture enabled, NativeWind v4 for styling." Models default to React Navigation (not Expo Router), StyleSheet (not NativeWind), and the legacy bridge architecture. Specifying all four prevents the most common version drift mistakes.

1. Expo Router App Architecture

⌥ PROMPT
You are a senior React Native architect using Expo SDK 52 and Expo Router v4.

Design a production mobile app architecture for a project management app targeting iOS and Android (with web support via Expo):

Navigation structure (Expo Router file-based):
- (auth)/login, (auth)/register, (auth)/forgot-password
- (app)/(tabs)/home, (app)/(tabs)/projects, (app)/(tabs)/notifications, (app)/(tabs)/profile
- (app)/project/[id], (app)/task/[id], (app)/settings/index

State management: Zustand stores (authStore, projectStore, taskStore, uiStore)
Data fetching: TanStack Query v5 with offline support
Storage: WatermelonDB for offline-first data, expo-secure-store for tokens
Push notifications: Expo Notifications + push token registration

Deliver:
1. Full app/ directory tree
2. Root layout setup: auth state guard, theme provider, toast, deep link handling
3. Tab bar configuration with badge counts
4. Authentication flow: how unauthenticated users are redirected, how deep links work post-login
5. Environment config: app.config.ts with EAS Build environment support

2. Authentication with Biometrics & Secure Storage

⌥ PROMPT
You are a React Native security engineer.

Implement a complete authentication system for Expo:

Token storage (NEVER AsyncStorage for sensitive data):
- expo-secure-store: store access token, refresh token, user ID
- Keychain (iOS) / Android Keystore (Android) via expo-secure-store

Auth flow:
- Login: POST to API, store tokens in SecureStore, navigate to (app) group
- Auto-login: on app launch, check SecureStore for tokens, validate access token, refresh if expired
- Logout: clear SecureStore, reset Zustand stores, navigate to (auth) group (replace, not push)
- Token refresh: Axios interceptor catches 401, refreshes token, retries original request

Biometric unlock:
- On login success: ask user to enable biometric unlock (expo-local-authentication)
- On next launch: if biometric enrolled, show biometric prompt instead of password form
- Fallback: if biometric fails 3 times, show PIN or password form

Security:
- Jailbreak/root detection: expo-device + check for common jailbreak indicators
- Certificate pinning: add to Axios for production API calls
- App lock: after 5 minutes of background, require biometric/PIN on return to foreground

TypeScript. Output: auth service, SecureStore utility, biometric hook, and auth Zustand store.

3. Offline-First Data Sync with WatermelonDB

⌥ PROMPT
You are a mobile offline sync expert.

Implement offline-first data synchronisation for a React Native task management app using WatermelonDB:

Database schema (schema.ts):
- tasks table: id (string), title, description, status, priority, due_date, assigned_to_id, project_id, organization_id, is_deleted, created_at, updated_at, server_updated_at
- projects table: similar structure
- sync_log table: entity, entity_id, action (create/update/delete), synced (boolean), created_at

Sync strategy:
- On app launch + network reconnect: pull changes from server (delta sync using last_sync_timestamp)
- On every mutation: write to local DB immediately (optimistic), queue sync operation
- Background sync: every 60 seconds when app is in foreground and network is available
- Conflict resolution: server_updated_at comparison → server wins if server is newer

Network state: @react-native-community/netinfo — pause sync attempts when offline, resume on reconnect

UI integration:
- Show sync status indicator (syncing / synced / pending X changes / sync error)
- Optimistic UI: mutations visible immediately even before sync
- Conflict notification: toast when a server conflict overwrites a local change

Output: WatermelonDB schema, sync service, network hook, and a task model with sync methods.

4. React Native Animations with Reanimated 3

⌥ PROMPT
You are a React Native animations expert using Reanimated 3 and Gesture Handler v2.

Build these production-quality animated components:

1. Swipeable task row (like iOS Mail):
   - Swipe left: reveal Delete action (red background)
   - Swipe right: reveal Complete action (green background)
   - Threshold: snap to action at 40% of row width, snap back if released before threshold
   - haptics: Haptics.impactAsync on snap
   - Implementation: Gesture.Pan() + useAnimatedStyle + withSpring

2. Drag-to-reorder list:
   - Long press activates drag mode (scale up to 1.05, shadow elevation)
   - Pan gesture moves item vertically
   - Other items animate to make space using layout animations
   - On release: snap to new position, call onReorder(from, to)

3. Animated task completion checkbox:
   - Tap: scale bounce + checkmark SVG draws with path animation
   - Colour transition: border grey → background green + checkmark white
   - Duration: 300ms with spring easing

Requirements: All animations on UI thread (worklets). No JS thread involvement during gestures.
TypeScript. Explain why each animation is worklet-safe.

5. Push Notifications

⌥ PROMPT
You are a React Native push notification expert.

Implement push notifications for an Expo app:

Setup:
- expo-notifications: request permissions on first launch (after user is onboarded, not on first open)
- expo-device: check if physical device (simulators cannot receive push notifications)
- Register push token with backend API: POST /api/devices/register { token, platform, deviceId }
- Re-register token on app update (token can change)

Notification handling:
- Foreground: in-app banner using expo-notifications setNotificationHandler (custom UI, not system banner)
- Background tap: useLastNotificationResponse → navigate to relevant screen based on notification data
- Deep link in notification: { type: 'task', taskId: '123' } → navigate to /task/123

Server-side token management:
- Store tokens per user per device (one user may have multiple devices)
- Remove stale tokens: handle DeviceNotRegistered error from FCM/APNs → delete from DB
- Notification categories: task_assigned, task_due, comment_added, project_update

Local notifications:
- Schedule local reminder for tasks with due dates (expo-notifications scheduleNotificationAsync)
- Cancel on task completion or deletion

Output: notification service, permission hook, background handler setup, and token registration API route.

6. Performance Optimisation

⌥ PROMPT
You are a React Native performance engineer.

Optimise this task list screen with 500+ items:

[PASTE SCREEN CODE]

Fix every performance issue:

1. FlatList optimisation:
   - keyExtractor: use stable string IDs (not array index)
   - getItemLayout: provide fixed height if rows have consistent height (eliminates measurement overhead)
   - removeClippedSubviews: true on Android
   - maxToRenderPerBatch: 10, windowSize: 5, initialNumToRender: 15
   - ItemSeparatorComponent instead of margin on items

2. Re-render prevention:
   - Wrap list item in React.memo() with custom areEqual comparator
   - Extract renderItem to a stable reference (useCallback or component definition outside)
   - Use Zustand selectors to subscribe only to the specific slice each item needs

3. Image optimisation:
   - Replace Image with expo-image: blurhash placeholder, priority hint, contentFit
   - Disable image animation on initial load (it causes jank on mount)

4. Interaction responsiveness:
   - Move filter/sort computation to useMemo
   - Defer non-critical renders with useTransition (React 19)

5. JS thread profiling: show how to use React Native DevTools and Flashlight to measure before/after

Output: optimised screen code with inline comments explaining each change.

8. Push Notifications with Expo Notifications

⌥ PROMPT
You are a React Native engineer specializing in mobile notifications.

Implement push notifications in an Expo SDK 52 app:

Setup:
- expo-notifications for local and push notifications
- EAS Push Notification service (not Firebase directly — Expo abstracts it)
- expo-device to check if running on physical device (simulators can't receive push)

Permissions: request notification permissions on first app open, handle denied gracefully (show settings deep-link)

Token registration:
- Get Expo Push Token: Notifications.getExpoPushTokenAsync({ projectId: Constants.expoConfig.extra.eas.projectId })
- Send token to backend API: POST /devices/register with { token, platform: Platform.OS, deviceId }
- Update token on app resume if token changed (tokens rotate)

Local notifications:
- scheduleNotificationAsync: task due tomorrow reminder at 9am
- cancelScheduledNotificationAsync: when task is completed or deleted

Notification handler:
- setNotificationHandler: set shouldShowAlert, shouldPlaySound, shouldSetBadge
- addNotificationReceivedListener: when app is in foreground — show in-app toast instead of system notification
- addNotificationResponseReceivedListener: handle notification tap — navigate to the relevant task

Badge count: reset to 0 on app foreground (iOS)

Output: notification service module, token registration hook, permission request component, and notification tap handler that integrates with Expo Router.

End-to-End Workflow: New Screen with Data

Building a new screen end-to-end using Expo Router and React Query:

  1. Route file: "Create app/(tabs)/tasks/[id].tsx Expo Router screen: typed params with useLocalSearchParams<{ id: string }>(), back button in header via Stack.Screen options."
  2. Data fetching: "Create useTask(id: string) React Query hook: GET /tasks/{id}, enable only when id is defined, staleTime: 60000, select to transform API response to UI-ready shape."
  3. Component (Prompt 2 variant): "Build TaskDetailScreen component: show skeleton while loading (use react-native-skeleton-placeholder), error state with retry button, task data with Reanimated 3 fade-in on load."
  4. Mutation: "Add completeTask mutation: PATCH /tasks/{id}/complete, optimistic update to set task.status='completed' in cache, toast on success via custom useToast hook."
  5. Tests (Prompt 6 variant): "Write jest tests for TaskDetailScreen: mock react-query, test loading state renders skeleton, error state shows retry, completed task shows completion badge."

Where AI Goes Wrong in React Native

  • React Navigation instead of Expo Router. Expo Router is the recommended navigation for Expo apps since SDK 49. AI defaults to React Navigation with manual stack configuration. Specify "Expo Router v4 with file-based routing — not React Navigation."
  • StyleSheet instead of NativeWind. If your project uses NativeWind v4 (Tailwind for React Native), AI generates StyleSheet.create() objects. These styles won't apply. Specify "NativeWind v4 className props — not StyleSheet."
  • Blocking the JS thread with heavy computation. AI generates data processing inside render functions or useEffect without moving heavy work to a web worker or Reanimated worklet. This drops frames. Ask explicitly for "run heavy computation on a separate thread using react-native-worklets-core or web workers."
  • Missing Android-specific permission handling. iOS permission prompts work differently from Android. AI often generates only the iOS requestPermissionsAsync pattern without the Android PermissionsAndroid.request() flow. Always test on both platforms.
  • Outdated Expo SDK APIs. Expo deprecates APIs across SDK releases. AI generates deprecated Camera API (expo-camera v13 vs v14), old SecureStore syntax, and outdated FileSystem paths. Always specify the SDK version and check against the Expo changelog.

7. Good vs Bad React Native Prompts

Task❌ Bad Prompt✅ Good Prompt
Animation"Animate a button in React Native""Build a React Native button with Reanimated 3: tap → scale to 0.95 with withSpring, release → scale back to 1. Add haptic feedback on press. worklet-safe — no JS thread involvement. TypeScript, Expo SDK 52."
Auth"Add login to my app""Implement React Native login with Expo: store JWT in expo-secure-store (not AsyncStorage), biometric unlock with expo-local-authentication, Axios interceptor for token refresh on 401, and navigate with router.replace() on login/logout to prevent back-navigation to auth screens."
Performance"Make my list faster""Optimise my FlatList with 500 tasks: add getItemLayout for fixed 72px row height, wrap TaskRow in React.memo with custom comparator, move renderItem to useCallback, add removeClippedSubviews on Android. Show before/after with Flashlight benchmark command."

Before You Prompt: React Native Context Setup

React Native has more version-sensitive APIs than almost any other framework. Expo SDK versions, New Architecture compatibility, and the Expo Router vs React Navigation split mean AI-generated code can be broken before you run it. Paste this block at the start of every session:

⌥ PROMPT
Context for all React Native prompts in this session:
- Runtime: Expo SDK 52, New Architecture enabled (Fabric + JSI)
- Navigation: Expo Router v4 — file-based routing in app/ directory
  Never generate: React Navigation manual stack setup
- Styling: NativeWind v4 (Tailwind className props)
  Never generate: StyleSheet.create() unless I explicitly ask
- State: Zustand 5 for UI state, TanStack Query v5 for server state
- Storage: expo-secure-store for tokens (NEVER AsyncStorage for sensitive data)
  Offline data: WatermelonDB
- Animations: Reanimated 3 (useSharedValue, useAnimatedStyle, worklets)
  Never generate: legacy Animated API (Animated.spring, Animated.timing, Animated.Value)
- TypeScript: strict mode
- Target platforms: iOS 16+ and Android 12+ (API 31+)
- Build system: EAS Build

Update this block every time you upgrade a major Expo SDK version. The version constraint is critical — expo-camera v13 and v14 have incompatible APIs, expo-notifications changed in SDK 50, and Expo Router file conventions changed between v3 and v4. AI has seen many versions of these APIs in training data and mixes them without explicit version pins. Teams that maintain this block as a committed file reduce context errors dramatically.

3 Common Mistakes When Prompting AI for React Native

Mistake 1: Asking for "navigation" without specifying Expo Router

React Navigation and Expo Router are completely different systems. AI defaults to React Navigation's imperative navigation.navigate('Screen') and manual createNativeStackNavigator() configuration. Expo Router uses file-based routing and router.push('/screen') from expo-router. A screen component that works in React Navigation is structurally different from an Expo Router screen file. Say "Expo Router v4 with file-based routing in the app/ directory" in every navigation prompt — even if your context block already says it.

Mistake 2: Storing authentication tokens in AsyncStorage

AsyncStorage is unencrypted and readable by any process on a rooted or jailbroken device. AI still generates AsyncStorage.setItem('accessToken', jwt) because the majority of code examples in its training data do this. It is the single most common React Native security mistake. Whenever AI suggests AsyncStorage for tokens, credentials, or user IDs, replace it with expo-secure-store. A no-restricted-imports ESLint rule that flags AsyncStorage in auth-related files catches this in CI without code review overhead.

Mistake 3: Using the legacy Animated API instead of Reanimated 3

React Native's built-in Animated API runs on the JavaScript thread. When the JS thread is busy — navigating, re-rendering a large list, fetching data — animations stutter. Reanimated 3 moves all animation logic to the UI thread via worklets, producing 60fps animations regardless of JS thread load. AI defaults to Animated.spring() and Animated.Value because legacy code dominates its training data. Always specify: "Reanimated 3 with useSharedValue, useAnimatedStyle, and worklet-safe functions — no JS thread involvement during animation."

Further Reading

More resources on AI-assisted React Native and mobile development:

Generate a custom React Native prompt → Try PromptPrepare free

Help & Answers

Frequently Asked Questions

John AllickAI Researcher· Updated May 10, 2026

John Allick is an AI researcher specializing in prompt engineering and large language model evaluation. He benchmarks models across ChatGPT, Claude, Gemini, Grok, and DeepSeek, focusing on practical techniques that produce reliable, production-ready outputs. Every guide on PromptPrepare is tested live on current model versions before publication.

✓ Expert-tested on live models✓ Updated May 10, 2026✓ Model-verified examples

Found this helpful?

Save it to your library or share with your team.

Keep Reading

Related Guides

Apply this guide instantly

Free AI prompt generator