AI-Assisted Image Handling
Let Cursor/Claude implement:
- Lazy loading strategies
- Cache management
- Progressive image loading
- Memory optimization
Master React Native development with Cursor IDE and Claude Code. These patterns cover cross-platform mobile development, native module integration, performance optimization, and deployment strategies for iOS and Android.
claude "Initialize a React Native TypeScript project with Expo, navigation, and state management"
// Use Cursor's Agent mode for component generation// Prompt: "Create a reusable Button component with:// - TypeScript support// - Multiple variants (primary, secondary, danger)// - Loading state// - Accessibility features// - Platform-specific styling"
// Agent will generate:import React from 'react';import { TouchableOpacity, Text, ActivityIndicator, StyleSheet, Platform, TouchableOpacityProps,} from 'react-native';
interface ButtonProps extends TouchableOpacityProps { variant?: 'primary' | 'secondary' | 'danger'; loading?: boolean; children: React.ReactNode;}
export const Button: React.FC<ButtonProps> = ({ variant = 'primary', loading = false, children, disabled, style, ...props}) => { // Component implementation with platform-specific styling};
# Use Claude Code's contextual understandingclaude --context "Create a themed Button component that follows our design system"
# Claude will analyze your existing components and create consistent patterns
// Cursor Agent Prompt:"Set up React Navigation with:- Bottom tab navigator- Stack navigators for each tab- Deep linking support- TypeScript types- Authentication flow"
// The agent will create a complete navigation structure
// Cursor prompt for lightweight state management:"Create a Zustand store for:- User authentication state- App settings- Offline queue for API calls- TypeScript interfaces"
// Cursor Agent can help with platform branching// Prompt: "Create iOS-specific haptic feedback implementation"
import { Platform, NativeModules } from 'react-native';
const HapticFeedback = Platform.select({ ios: () => NativeModules.HapticFeedback, android: () => null,})();
// Prompt: "Add Android-specific permissions handling"
import { PermissionsAndroid, Platform } from 'react-native';
const requestCameraPermission = async () => { if (Platform.OS === 'android') { // Android-specific implementation }};
// Cursor prompt for optimized lists:"Create a performant FlatList with:- Memo optimization- getItemLayout implementation- keyExtractor- onEndReached pagination- Empty state handling"
AI-Assisted Image Handling
Let Cursor/Claude implement:
// Cursor Agent prompt:"Write comprehensive tests for Button component using:- React Native Testing Library- Jest- Platform-specific test cases- Accessibility tests"
# Claude Code can set up debugging toolsclaude "Configure Flipper with:1. Network plugin for API debugging2. React DevTools integration3. AsyncStorage viewer4. Hermes debugger support"
# Cursor prompt: "Create GitHub Actions workflow for iOS deployment"# Includes:# - Certificate management# - TestFlight upload# - Version bumping
# Prompt: "Set up Android deployment with:# - Play Store upload# - App signing# - Release notes generation"
// Complete auth implementation prompt:"Implement authentication flow with:1. Login/Register screens2. Biometric authentication3. Token refresh logic4. Secure storage5. Deep linking for auth callbacks"
// Cursor Agent can implement:"Create offline-first architecture with:- SQLite local database- Sync queue for API calls- Conflict resolution- Background sync- Network state monitoring"
// Good prompt structure:"Create a [component type] that:- Requirement 1 with specific details- Requirement 2 with constraints- Follows our existing patterns in [file reference]- Includes TypeScript types- Has unit tests"
AI-Powered Code Review
Use Cursor/Claude to:
// Cursor can help create native modules// Prompt: "Create iOS native module for:// - Custom camera functionality// - Objective-C bridge// - Swift implementation// - TypeScript definitions"
// Implement performance tracking:"Add performance monitoring with:- Component render times- Navigation transitions- API response times- Memory usage alerts- Crash reporting"