[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72XQ558NPZQGHXAY7S208J7":3,"skill-same:01M72XQ558NPZQGHXAY7S208J7":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M72XQ558NPZQGHXAY7S208J7","react-native-architecture",null,"Build production React Native apps with Expo, navigation, native modules, offline sync, and cross-platform patterns. Use when developing mobile apps, implementing native integrations, or architecting React Native projects.","steph-frtech\u002Fclaude-code-up","steph-frtech","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F198466323?v=4","01M72XD213FVQA2QXRGTJFKHE1","01M72XD227AANJ993SQTNZB1CK",1,"MIT","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fmarketplaces\u002Fwshobson\u002Fplugins\u002Ffrontend-mobile-development\u002Fskills\u002Freact-native-architecture\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: react-native-architecture\ndescription: Build production React Native apps with Expo, navigation, native modules, offline sync, and cross-platform patterns. Use when developing mobile apps, implementing native integrations, or architecting React Native projects.\n---\n\n# React Native Architecture\n\nProduction-ready patterns for React Native development with Expo, including navigation, state management, native modules, and offline-first architecture.\n\n## When to Use This Skill\n\n- Starting a new React Native or Expo project\n- Implementing complex navigation patterns\n- Integrating native modules and platform APIs\n- Building offline-first mobile applications\n- Optimizing React Native performance\n- Setting up CI\u002FCD for mobile releases\n\n## Core Concepts\n\n### 1. Project Structure\n\n```\nsrc\u002F\n├── app\u002F                    # Expo Router screens\n│   ├── (auth)\u002F            # Auth group\n│   ├── (tabs)\u002F            # Tab navigation\n│   └── _layout.tsx        # Root layout\n├── components\u002F\n│   ├── ui\u002F                # Reusable UI components\n│   └── features\u002F          # Feature-specific components\n├── hooks\u002F                 # Custom hooks\n├── services\u002F              # API and native services\n├── stores\u002F                # State management\n├── utils\u002F                 # Utilities\n└── types\u002F                 # TypeScript types\n```\n\n### 2. Expo vs Bare React Native\n\n| Feature            | Expo           | Bare RN        |\n| ------------------ | -------------- | -------------- |\n| Setup complexity   | Low            | High           |\n| Native modules     | EAS Build      | Manual linking |\n| OTA updates        | Built-in       | Manual setup   |\n| Build service      | EAS            | Custom CI      |\n| Custom native code | Config plugins | Direct access  |\n\n## Quick Start\n\n```bash\n# Create new Expo project\nnpx create-expo-app@latest my-app -t expo-template-blank-typescript\n\n# Install essential dependencies\nnpx expo install expo-router expo-status-bar react-native-safe-area-context\nnpx expo install @react-native-async-storage\u002Fasync-storage\nnpx expo install expo-secure-store expo-haptics\n```\n\n```typescript\n\u002F\u002F app\u002F_layout.tsx\nimport { Stack } from 'expo-router'\nimport { ThemeProvider } from '@\u002Fproviders\u002FThemeProvider'\nimport { QueryProvider } from '@\u002Fproviders\u002FQueryProvider'\n\nexport default function RootLayout() {\n  return (\n    \u003CQueryProvider>\n      \u003CThemeProvider>\n        \u003CStack screenOptions={{ headerShown: false }}>\n          \u003CStack.Screen name=\"(tabs)\" \u002F>\n          \u003CStack.Screen name=\"(auth)\" \u002F>\n          \u003CStack.Screen name=\"modal\" options={{ presentation: 'modal' }} \u002F>\n        \u003C\u002FStack>\n      \u003C\u002FThemeProvider>\n    \u003C\u002FQueryProvider>\n  )\n}\n```\n\n## Patterns\n\n### Pattern 1: Expo Router Navigation\n\n```typescript\n\u002F\u002F app\u002F(tabs)\u002F_layout.tsx\nimport { Tabs } from 'expo-router'\nimport { Home, Search, User, Settings } from 'lucide-react-native'\nimport { useTheme } from '@\u002Fhooks\u002FuseTheme'\n\nexport default function TabLayout() {\n  const { colors } = useTheme()\n\n  return (\n    \u003CTabs\n      screenOptions={{\n        tabBarActiveTintColor: colors.primary,\n        tabBarInactiveTintColor: colors.textMuted,\n        tabBarStyle: { backgroundColor: colors.background },\n        headerShown: false,\n      }}\n    >\n      \u003CTabs.Screen\n        name=\"index\"\n        options={{\n          title: 'Home',\n          tabBarIcon: ({ color, size }) => \u003CHome size={size} color={color} \u002F>,\n        }}\n      \u002F>\n      \u003CTabs.Screen\n        name=\"search\"\n        options={{\n          title: 'Search',\n          tabBarIcon: ({ color, size }) => \u003CSearch size={size} color={color} \u002F>,\n        }}\n      \u002F>\n      \u003CTabs.Screen\n        name=\"profile\"\n        options={{\n          title: 'Profile',\n          tabBarIcon: ({ color, size }) => \u003CUser size={size} color={color} \u002F>,\n        }}\n      \u002F>\n      \u003CTabs.Screen\n        name=\"settings\"\n        options={{\n          title: 'Settings',\n          tabBarIcon: ({ color, size }) => \u003CSettings size={size} color={color} \u002F>,\n        }}\n      \u002F>\n    \u003C\u002FTabs>\n  )\n}\n\n\u002F\u002F app\u002F(tabs)\u002Fprofile\u002F[id].tsx - Dynamic route\nimport { useLocalSearchParams } from 'expo-router'\n\nexport default function ProfileScreen() {\n  const { id } = useLocalSearchParams\u003C{ id: string }>()\n\n  return \u003CUserProfile userId={id} \u002F>\n}\n\n\u002F\u002F Navigation from anywhere\nimport { router } from 'expo-router'\n\n\u002F\u002F Programmatic navigation\nrouter.push('\u002Fprofile\u002F123')\nrouter.replace('\u002Flogin')\nrouter.back()\n\n\u002F\u002F With params\nrouter.push({\n  pathname: '\u002Fproduct\u002F[id]',\n  params: { id: '123', referrer: 'home' },\n})\n```\n\n### Pattern 2: Authentication Flow\n\n```typescript\n\u002F\u002F providers\u002FAuthProvider.tsx\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport { useRouter, useSegments } from 'expo-router'\nimport * as SecureStore from 'expo-secure-store'\n\ninterface AuthContextType {\n  user: User | null\n  isLoading: boolean\n  signIn: (credentials: Credentials) => Promise\u003Cvoid>\n  signOut: () => Promise\u003Cvoid>\n}\n\nconst AuthContext = createContext\u003CAuthContextType | null>(null)\n\nexport function AuthProvider({ children }: { children: React.ReactNode }) {\n  const [user, setUser] = useState\u003CUser | null>(null)\n  const [isLoading, setIsLoading] = useState(true)\n  const segments = useSegments()\n  const router = useRouter()\n\n  \u002F\u002F Check authentication on mount\n  useEffect(() => {\n    checkAuth()\n  }, [])\n\n  \u002F\u002F Protect routes\n  useEffect(() => {\n    if (isLoading) return\n\n    const inAuthGroup = segments[0] === '(auth)'\n\n    if (!user && !inAuthGroup) {\n      router.replace('\u002Flogin')\n    } else if (user && inAuthGroup) {\n      router.replace('\u002F(tabs)')\n    }\n  }, [user, segments, isLoading])\n\n  async function checkAuth() {\n    try {\n      const token = await SecureStore.getItemAsync('authToken')\n      if (token) {\n        const userData = await api.getUser(token)\n        setUser(userData)\n      }\n    } catch (error) {\n      await SecureStore.deleteItemAsync('authToken')\n    } finally {\n      setIsLoading(false)\n    }\n  }\n\n  async function signIn(credentials: Credentials) {\n    const { token, user } = await api.login(credentials)\n    await SecureStore.setItemAsync('authToken', token)\n    setUser(user)\n  }\n\n  async function signOut() {\n    await SecureStore.deleteItemAsync('authToken')\n    setUser(null)\n  }\n\n  if (isLoading) {\n    return \u003CSplashScreen \u002F>\n  }\n\n  return (\n    \u003CAuthContext.Provider value={{ user, isLoading, signIn, signOut }}>\n      {children}\n    \u003C\u002FAuthContext.Provider>\n  )\n}\n\nexport const useAuth = () => {\n  const context = useContext(AuthContext)\n  if (!context) throw new Error('useAuth must be used within AuthProvider')\n  return context\n}\n```\n\n### Pattern 3: Offline-First with React Query\n\n```typescript\n\u002F\u002F providers\u002FQueryProvider.tsx\nimport { QueryClient, QueryClientProvider } from '@tanstack\u002Freact-query'\nimport { createAsyncStoragePersister } from '@tanstack\u002Fquery-async-storage-persister'\nimport { PersistQueryClientProvider } from '@tanstack\u002Freact-query-persist-client'\nimport AsyncStorage from '@react-native-async-storage\u002Fasync-storage'\nimport NetInfo from '@react-native-community\u002Fnetinfo'\nimport { onlineManager } from '@tanstack\u002Freact-query'\n\n\u002F\u002F Sync online status\nonlineManager.setEventListener((setOnline) => {\n  return NetInfo.addEventListener((state) => {\n    setOnline(!!state.isConnected)\n  })\n})\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      gcTime: 1000 * 60 * 60 * 24, \u002F\u002F 24 hours\n      staleTime: 1000 * 60 * 5, \u002F\u002F 5 minutes\n      retry: 2,\n      networkMode: 'offlineFirst',\n    },\n    mutations: {\n      networkMode: 'offlineFirst',\n    },\n  },\n})\n\nconst asyncStoragePersister = createAsyncStoragePersister({\n  storage: AsyncStorage,\n  key: 'REACT_QUERY_OFFLINE_CACHE',\n})\n\nexport function QueryProvider({ children }: { children: React.ReactNode }) {\n  return (\n    \u003CPersistQueryClientProvider\n      client={queryClient}\n      persistOptions={{ persister: asyncStoragePersister }}\n    >\n      {children}\n    \u003C\u002FPersistQueryClientProvider>\n  )\n}\n\n\u002F\u002F hooks\u002FuseProducts.ts\nimport { useQuery, useMutation, useQueryClient } from '@tanstack\u002Freact-query'\n\nexport function useProducts() {\n  return useQuery({\n    queryKey: ['products'],\n    queryFn: api.getProducts,\n    \u002F\u002F Use stale data while revalidating\n    placeholderData: (previousData) => previousData,\n  })\n}\n\nexport function useCreateProduct() {\n  const queryClient = useQueryClient()\n\n  return useMutation({\n    mutationFn: api.createProduct,\n    \u002F\u002F Optimistic update\n    onMutate: async (newProduct) => {\n      await queryClient.cancelQueries({ queryKey: ['products'] })\n      const previous = queryClient.getQueryData(['products'])\n\n      queryClient.setQueryData(['products'], (old: Product[]) => [\n        ...old,\n        { ...newProduct, id: 'temp-' + Date.now() },\n      ])\n\n      return { previous }\n    },\n    onError: (err, newProduct, context) => {\n      queryClient.setQueryData(['products'], context?.previous)\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: ['products'] })\n    },\n  })\n}\n```\n\n### Pattern 4: Native Module Integration\n\n```typescript\n\u002F\u002F services\u002Fhaptics.ts\nimport * as Haptics from \"expo-haptics\";\nimport { Platform } from \"react-native\";\n\nexport const haptics = {\n  light: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);\n    }\n  },\n  medium: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);\n    }\n  },\n  heavy: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);\n    }\n  },\n  success: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);\n    }\n  },\n  error: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);\n    }\n  },\n};\n\n\u002F\u002F services\u002Fbiometrics.ts\nimport * as LocalAuthentication from \"expo-local-authentication\";\n\nexport async function authenticateWithBiometrics(): Promise\u003Cboolean> {\n  const hasHardware = await LocalAuthentication.hasHardwareAsync();\n  if (!hasHardware) return false;\n\n  const isEnrolled = await LocalAuthentication.isEnrolledAsync();\n  if (!isEnrolled) return false;\n\n  const result = await LocalAuthentication.authenticateAsync({\n    promptMessage: \"Authenticate to continue\",\n    fallbackLabel: \"Use passcode\",\n    disableDeviceFallback: false,\n  });\n\n  return result.success;\n}\n\n\u002F\u002F services\u002Fnotifications.ts\nimport * as Notifications from \"expo-notifications\";\nimport { Platform } from \"react-native\";\nimport Constants from \"expo-constants\";\n\nNotifications.setNotificationHandler({\n  handleNotification: async () => ({\n    shouldShowAlert: true,\n    shouldPlaySound: true,\n    shouldSetBadge: true,\n  }),\n});\n\nexport async function registerForPushNotifications() {\n  let token: string | undefined;\n\n  if (Platform.OS === \"android\") {\n    await Notifications.setNotificationChannelAsync(\"default\", {\n      name: \"default\",\n      importance: Notifications.AndroidImportance.MAX,\n      vibrationPattern: [0, 250, 250, 250],\n    });\n  }\n\n  const { status: existingStatus } = await Notifications.getPermissionsAsync();\n  let finalStatus = existingStatus;\n\n  if (existingStatus !== \"granted\") {\n    const { status } = await Notifications.requestPermissionsAsync();\n    finalStatus = status;\n  }\n\n  if (finalStatus !== \"granted\") {\n    return null;\n  }\n\n  const projectId = Constants.expoConfig?.extra?.eas?.projectId;\n  token = (await Notifications.getExpoPushTokenAsync({ projectId })).data;\n\n  return token;\n}\n```\n\n### Pattern 5: Platform-Specific Code\n\n```typescript\n\u002F\u002F components\u002Fui\u002FButton.tsx\nimport { Platform, Pressable, StyleSheet, Text, ViewStyle } from 'react-native'\nimport * as Haptics from 'expo-haptics'\nimport Animated, {\n  useAnimatedStyle,\n  useSharedValue,\n  withSpring,\n} from 'react-native-reanimated'\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable)\n\ninterface ButtonProps {\n  title: string\n  onPress: () => void\n  variant?: 'primary' | 'secondary' | 'outline'\n  disabled?: boolean\n}\n\nexport function Button({\n  title,\n  onPress,\n  variant = 'primary',\n  disabled = false,\n}: ButtonProps) {\n  const scale = useSharedValue(1)\n\n  const animatedStyle = useAnimatedStyle(() => ({\n    transform: [{ scale: scale.value }],\n  }))\n\n  const handlePressIn = () => {\n    scale.value = withSpring(0.95)\n    if (Platform.OS !== 'web') {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)\n    }\n  }\n\n  const handlePressOut = () => {\n    scale.value = withSpring(1)\n  }\n\n  return (\n    \u003CAnimatedPressable\n      onPress={onPress}\n      onPressIn={handlePressIn}\n      onPressOut={handlePressOut}\n      disabled={disabled}\n      style={[\n        styles.button,\n        styles[variant],\n        disabled && styles.disabled,\n        animatedStyle,\n      ]}\n    >\n      \u003CText style={[styles.text, styles[`${variant}Text`]]}>{title}\u003C\u002FText>\n    \u003C\u002FAnimatedPressable>\n  )\n}\n\n\u002F\u002F Platform-specific files\n\u002F\u002F Button.ios.tsx - iOS-specific implementation\n\u002F\u002F Button.android.tsx - Android-specific implementation\n\u002F\u002F Button.web.tsx - Web-specific implementation\n\n\u002F\u002F Or use Platform.select\nconst styles = StyleSheet.create({\n  button: {\n    paddingVertical: 12,\n    paddingHorizontal: 24,\n    borderRadius: 8,\n    alignItems: 'center',\n    ...Platform.select({\n      ios: {\n        shadowColor: '#000',\n        shadowOffset: { width: 0, height: 2 },\n        shadowOpacity: 0.1,\n        shadowRadius: 4,\n      },\n      android: {\n        elevation: 4,\n      },\n    }),\n  },\n  primary: {\n    backgroundColor: '#007AFF',\n  },\n  secondary: {\n    backgroundColor: '#5856D6',\n  },\n  outline: {\n    backgroundColor: 'transparent',\n    borderWidth: 1,\n    borderColor: '#007AFF',\n  },\n  disabled: {\n    opacity: 0.5,\n  },\n  text: {\n    fontSize: 16,\n    fontWeight: '600',\n  },\n  primaryText: {\n    color: '#FFFFFF',\n  },\n  secondaryText: {\n    color: '#FFFFFF',\n  },\n  outlineText: {\n    color: '#007AFF',\n  },\n})\n```\n\n### Pattern 6: Performance Optimization\n\n```typescript\n\u002F\u002F components\u002FProductList.tsx\nimport { FlashList } from '@shopify\u002Fflash-list'\nimport { memo, useCallback } from 'react'\n\ninterface ProductListProps {\n  products: Product[]\n  onProductPress: (id: string) => void\n}\n\n\u002F\u002F Memoize list item\nconst ProductItem = memo(function ProductItem({\n  item,\n  onPress,\n}: {\n  item: Product\n  onPress: (id: string) => void\n}) {\n  const handlePress = useCallback(() => onPress(item.id), [item.id, onPress])\n\n  return (\n    \u003CPressable onPress={handlePress} style={styles.item}>\n      \u003CFastImage\n        source={{ uri: item.image }}\n        style={styles.image}\n        resizeMode=\"cover\"\n      \u002F>\n      \u003CText style={styles.title}>{item.name}\u003C\u002FText>\n      \u003CText style={styles.price}>${item.price}\u003C\u002FText>\n    \u003C\u002FPressable>\n  )\n})\n\nexport function ProductList({ products, onProductPress }: ProductListProps) {\n  const renderItem = useCallback(\n    ({ item }: { item: Product }) => (\n      \u003CProductItem item={item} onPress={onProductPress} \u002F>\n    ),\n    [onProductPress]\n  )\n\n  const keyExtractor = useCallback((item: Product) => item.id, [])\n\n  return (\n    \u003CFlashList\n      data={products}\n      renderItem={renderItem}\n      keyExtractor={keyExtractor}\n      estimatedItemSize={100}\n      \u002F\u002F Performance optimizations\n      removeClippedSubviews={true}\n      maxToRenderPerBatch={10}\n      windowSize={5}\n      \u002F\u002F Pull to refresh\n      onRefresh={onRefresh}\n      refreshing={isRefreshing}\n    \u002F>\n  )\n}\n```\n\n## EAS Build & Submit\n\n```json\n\u002F\u002F eas.json\n{\n  \"cli\": { \"version\": \">= 5.0.0\" },\n  \"build\": {\n    \"development\": {\n      \"developmentClient\": true,\n      \"distribution\": \"internal\",\n      \"ios\": { \"simulator\": true }\n    },\n    \"preview\": {\n      \"distribution\": \"internal\",\n      \"android\": { \"buildType\": \"apk\" }\n    },\n    \"production\": {\n      \"autoIncrement\": true\n    }\n  },\n  \"submit\": {\n    \"production\": {\n      \"ios\": { \"appleId\": \"your@email.com\", \"ascAppId\": \"123456789\" },\n      \"android\": { \"serviceAccountKeyPath\": \".\u002Fgoogle-services.json\" }\n    }\n  }\n}\n```\n\n```bash\n# Build commands\neas build --platform ios --profile development\neas build --platform android --profile preview\neas build --platform all --profile production\n\n# Submit to stores\neas submit --platform ios\neas submit --platform android\n\n# OTA updates\neas update --branch production --message \"Bug fixes\"\n```\n\n## Best Practices\n\n### Do's\n\n- **Use Expo** - Faster development, OTA updates, managed native code\n- **FlashList over FlatList** - Better performance for long lists\n- **Memoize components** - Prevent unnecessary re-renders\n- **Use Reanimated** - 60fps animations on native thread\n- **Test on real devices** - Simulators miss real-world issues\n\n### Don'ts\n\n- **Don't inline styles** - Use StyleSheet.create for performance\n- **Don't fetch in render** - Use useEffect or React Query\n- **Don't ignore platform differences** - Test on both iOS and Android\n- **Don't store secrets in code** - Use environment variables\n- **Don't skip error boundaries** - Mobile crashes are unforgiving\n","# React Native Architecture\n\nProduction-ready patterns for React Native development with Expo, including navigation, state management, native modules, and offline-first architecture.\n\n## When to Use This Skill\n\n- Starting a new React Native or Expo project\n- Implementing complex navigation patterns\n- Integrating native modules and platform APIs\n- Building offline-first mobile applications\n- Optimizing React Native performance\n- Setting up CI\u002FCD for mobile releases\n\n## Core Concepts\n\n### 1. Project Structure\n\n```\nsrc\u002F\n├── app\u002F                    # Expo Router screens\n│   ├── (auth)\u002F            # Auth group\n│   ├── (tabs)\u002F            # Tab navigation\n│   └── _layout.tsx        # Root layout\n├── components\u002F\n│   ├── ui\u002F                # Reusable UI components\n│   └── features\u002F          # Feature-specific components\n├── hooks\u002F                 # Custom hooks\n├── services\u002F              # API and native services\n├── stores\u002F                # State management\n├── utils\u002F                 # Utilities\n└── types\u002F                 # TypeScript types\n```\n\n### 2. Expo vs Bare React Native\n\n| Feature            | Expo           | Bare RN        |\n| ------------------ | -------------- | -------------- |\n| Setup complexity   | Low            | High           |\n| Native modules     | EAS Build      | Manual linking |\n| OTA updates        | Built-in       | Manual setup   |\n| Build service      | EAS            | Custom CI      |\n| Custom native code | Config plugins | Direct access  |\n\n## Quick Start\n\n```bash\n# Create new Expo project\nnpx create-expo-app@latest my-app -t expo-template-blank-typescript\n\n# Install essential dependencies\nnpx expo install expo-router expo-status-bar react-native-safe-area-context\nnpx expo install @react-native-async-storage\u002Fasync-storage\nnpx expo install expo-secure-store expo-haptics\n```\n\n```typescript\n\u002F\u002F app\u002F_layout.tsx\nimport { Stack } from 'expo-router'\nimport { ThemeProvider } from '@\u002Fproviders\u002FThemeProvider'\nimport { QueryProvider } from '@\u002Fproviders\u002FQueryProvider'\n\nexport default function RootLayout() {\n  return (\n    \u003CQueryProvider>\n      \u003CThemeProvider>\n        \u003CStack screenOptions={{ headerShown: false }}>\n          \u003CStack.Screen name=\"(tabs)\" \u002F>\n          \u003CStack.Screen name=\"(auth)\" \u002F>\n          \u003CStack.Screen name=\"modal\" options={{ presentation: 'modal' }} \u002F>\n        \u003C\u002FStack>\n      \u003C\u002FThemeProvider>\n    \u003C\u002FQueryProvider>\n  )\n}\n```\n\n## Patterns\n\n### Pattern 1: Expo Router Navigation\n\n```typescript\n\u002F\u002F app\u002F(tabs)\u002F_layout.tsx\nimport { Tabs } from 'expo-router'\nimport { Home, Search, User, Settings } from 'lucide-react-native'\nimport { useTheme } from '@\u002Fhooks\u002FuseTheme'\n\nexport default function TabLayout() {\n  const { colors } = useTheme()\n\n  return (\n    \u003CTabs\n      screenOptions={{\n        tabBarActiveTintColor: colors.primary,\n        tabBarInactiveTintColor: colors.textMuted,\n        tabBarStyle: { backgroundColor: colors.background },\n        headerShown: false,\n      }}\n    >\n      \u003CTabs.Screen\n        name=\"index\"\n        options={{\n          title: 'Home',\n          tabBarIcon: ({ color, size }) => \u003CHome size={size} color={color} \u002F>,\n        }}\n      \u002F>\n      \u003CTabs.Screen\n        name=\"search\"\n        options={{\n          title: 'Search',\n          tabBarIcon: ({ color, size }) => \u003CSearch size={size} color={color} \u002F>,\n        }}\n      \u002F>\n      \u003CTabs.Screen\n        name=\"profile\"\n        options={{\n          title: 'Profile',\n          tabBarIcon: ({ color, size }) => \u003CUser size={size} color={color} \u002F>,\n        }}\n      \u002F>\n      \u003CTabs.Screen\n        name=\"settings\"\n        options={{\n          title: 'Settings',\n          tabBarIcon: ({ color, size }) => \u003CSettings size={size} color={color} \u002F>,\n        }}\n      \u002F>\n    \u003C\u002FTabs>\n  )\n}\n\n\u002F\u002F app\u002F(tabs)\u002Fprofile\u002F[id].tsx - Dynamic route\nimport { useLocalSearchParams } from 'expo-router'\n\nexport default function ProfileScreen() {\n  const { id } = useLocalSearchParams\u003C{ id: string }>()\n\n  return \u003CUserProfile userId={id} \u002F>\n}\n\n\u002F\u002F Navigation from anywhere\nimport { router } from 'expo-router'\n\n\u002F\u002F Programmatic navigation\nrouter.push('\u002Fprofile\u002F123')\nrouter.replace('\u002Flogin')\nrouter.back()\n\n\u002F\u002F With params\nrouter.push({\n  pathname: '\u002Fproduct\u002F[id]',\n  params: { id: '123', referrer: 'home' },\n})\n```\n\n### Pattern 2: Authentication Flow\n\n```typescript\n\u002F\u002F providers\u002FAuthProvider.tsx\nimport { createContext, useContext, useEffect, useState } from 'react'\nimport { useRouter, useSegments } from 'expo-router'\nimport * as SecureStore from 'expo-secure-store'\n\ninterface AuthContextType {\n  user: User | null\n  isLoading: boolean\n  signIn: (credentials: Credentials) => Promise\u003Cvoid>\n  signOut: () => Promise\u003Cvoid>\n}\n\nconst AuthContext = createContext\u003CAuthContextType | null>(null)\n\nexport function AuthProvider({ children }: { children: React.ReactNode }) {\n  const [user, setUser] = useState\u003CUser | null>(null)\n  const [isLoading, setIsLoading] = useState(true)\n  const segments = useSegments()\n  const router = useRouter()\n\n  \u002F\u002F Check authentication on mount\n  useEffect(() => {\n    checkAuth()\n  }, [])\n\n  \u002F\u002F Protect routes\n  useEffect(() => {\n    if (isLoading) return\n\n    const inAuthGroup = segments[0] === '(auth)'\n\n    if (!user && !inAuthGroup) {\n      router.replace('\u002Flogin')\n    } else if (user && inAuthGroup) {\n      router.replace('\u002F(tabs)')\n    }\n  }, [user, segments, isLoading])\n\n  async function checkAuth() {\n    try {\n      const token = await SecureStore.getItemAsync('authToken')\n      if (token) {\n        const userData = await api.getUser(token)\n        setUser(userData)\n      }\n    } catch (error) {\n      await SecureStore.deleteItemAsync('authToken')\n    } finally {\n      setIsLoading(false)\n    }\n  }\n\n  async function signIn(credentials: Credentials) {\n    const { token, user } = await api.login(credentials)\n    await SecureStore.setItemAsync('authToken', token)\n    setUser(user)\n  }\n\n  async function signOut() {\n    await SecureStore.deleteItemAsync('authToken')\n    setUser(null)\n  }\n\n  if (isLoading) {\n    return \u003CSplashScreen \u002F>\n  }\n\n  return (\n    \u003CAuthContext.Provider value={{ user, isLoading, signIn, signOut }}>\n      {children}\n    \u003C\u002FAuthContext.Provider>\n  )\n}\n\nexport const useAuth = () => {\n  const context = useContext(AuthContext)\n  if (!context) throw new Error('useAuth must be used within AuthProvider')\n  return context\n}\n```\n\n### Pattern 3: Offline-First with React Query\n\n```typescript\n\u002F\u002F providers\u002FQueryProvider.tsx\nimport { QueryClient, QueryClientProvider } from '@tanstack\u002Freact-query'\nimport { createAsyncStoragePersister } from '@tanstack\u002Fquery-async-storage-persister'\nimport { PersistQueryClientProvider } from '@tanstack\u002Freact-query-persist-client'\nimport AsyncStorage from '@react-native-async-storage\u002Fasync-storage'\nimport NetInfo from '@react-native-community\u002Fnetinfo'\nimport { onlineManager } from '@tanstack\u002Freact-query'\n\n\u002F\u002F Sync online status\nonlineManager.setEventListener((setOnline) => {\n  return NetInfo.addEventListener((state) => {\n    setOnline(!!state.isConnected)\n  })\n})\n\nconst queryClient = new QueryClient({\n  defaultOptions: {\n    queries: {\n      gcTime: 1000 * 60 * 60 * 24, \u002F\u002F 24 hours\n      staleTime: 1000 * 60 * 5, \u002F\u002F 5 minutes\n      retry: 2,\n      networkMode: 'offlineFirst',\n    },\n    mutations: {\n      networkMode: 'offlineFirst',\n    },\n  },\n})\n\nconst asyncStoragePersister = createAsyncStoragePersister({\n  storage: AsyncStorage,\n  key: 'REACT_QUERY_OFFLINE_CACHE',\n})\n\nexport function QueryProvider({ children }: { children: React.ReactNode }) {\n  return (\n    \u003CPersistQueryClientProvider\n      client={queryClient}\n      persistOptions={{ persister: asyncStoragePersister }}\n    >\n      {children}\n    \u003C\u002FPersistQueryClientProvider>\n  )\n}\n\n\u002F\u002F hooks\u002FuseProducts.ts\nimport { useQuery, useMutation, useQueryClient } from '@tanstack\u002Freact-query'\n\nexport function useProducts() {\n  return useQuery({\n    queryKey: ['products'],\n    queryFn: api.getProducts,\n    \u002F\u002F Use stale data while revalidating\n    placeholderData: (previousData) => previousData,\n  })\n}\n\nexport function useCreateProduct() {\n  const queryClient = useQueryClient()\n\n  return useMutation({\n    mutationFn: api.createProduct,\n    \u002F\u002F Optimistic update\n    onMutate: async (newProduct) => {\n      await queryClient.cancelQueries({ queryKey: ['products'] })\n      const previous = queryClient.getQueryData(['products'])\n\n      queryClient.setQueryData(['products'], (old: Product[]) => [\n        ...old,\n        { ...newProduct, id: 'temp-' + Date.now() },\n      ])\n\n      return { previous }\n    },\n    onError: (err, newProduct, context) => {\n      queryClient.setQueryData(['products'], context?.previous)\n    },\n    onSettled: () => {\n      queryClient.invalidateQueries({ queryKey: ['products'] })\n    },\n  })\n}\n```\n\n### Pattern 4: Native Module Integration\n\n```typescript\n\u002F\u002F services\u002Fhaptics.ts\nimport * as Haptics from \"expo-haptics\";\nimport { Platform } from \"react-native\";\n\nexport const haptics = {\n  light: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);\n    }\n  },\n  medium: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);\n    }\n  },\n  heavy: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);\n    }\n  },\n  success: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);\n    }\n  },\n  error: () => {\n    if (Platform.OS !== \"web\") {\n      Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);\n    }\n  },\n};\n\n\u002F\u002F services\u002Fbiometrics.ts\nimport * as LocalAuthentication from \"expo-local-authentication\";\n\nexport async function authenticateWithBiometrics(): Promise\u003Cboolean> {\n  const hasHardware = await LocalAuthentication.hasHardwareAsync();\n  if (!hasHardware) return false;\n\n  const isEnrolled = await LocalAuthentication.isEnrolledAsync();\n  if (!isEnrolled) return false;\n\n  const result = await LocalAuthentication.authenticateAsync({\n    promptMessage: \"Authenticate to continue\",\n    fallbackLabel: \"Use passcode\",\n    disableDeviceFallback: false,\n  });\n\n  return result.success;\n}\n\n\u002F\u002F services\u002Fnotifications.ts\nimport * as Notifications from \"expo-notifications\";\nimport { Platform } from \"react-native\";\nimport Constants from \"expo-constants\";\n\nNotifications.setNotificationHandler({\n  handleNotification: async () => ({\n    shouldShowAlert: true,\n    shouldPlaySound: true,\n    shouldSetBadge: true,\n  }),\n});\n\nexport async function registerForPushNotifications() {\n  let token: string | undefined;\n\n  if (Platform.OS === \"android\") {\n    await Notifications.setNotificationChannelAsync(\"default\", {\n      name: \"default\",\n      importance: Notifications.AndroidImportance.MAX,\n      vibrationPattern: [0, 250, 250, 250],\n    });\n  }\n\n  const { status: existingStatus } = await Notifications.getPermissionsAsync();\n  let finalStatus = existingStatus;\n\n  if (existingStatus !== \"granted\") {\n    const { status } = await Notifications.requestPermissionsAsync();\n    finalStatus = status;\n  }\n\n  if (finalStatus !== \"granted\") {\n    return null;\n  }\n\n  const projectId = Constants.expoConfig?.extra?.eas?.projectId;\n  token = (await Notifications.getExpoPushTokenAsync({ projectId })).data;\n\n  return token;\n}\n```\n\n### Pattern 5: Platform-Specific Code\n\n```typescript\n\u002F\u002F components\u002Fui\u002FButton.tsx\nimport { Platform, Pressable, StyleSheet, Text, ViewStyle } from 'react-native'\nimport * as Haptics from 'expo-haptics'\nimport Animated, {\n  useAnimatedStyle,\n  useSharedValue,\n  withSpring,\n} from 'react-native-reanimated'\n\nconst AnimatedPressable = Animated.createAnimatedComponent(Pressable)\n\ninterface ButtonProps {\n  title: string\n  onPress: () => void\n  variant?: 'primary' | 'secondary' | 'outline'\n  disabled?: boolean\n}\n\nexport function Button({\n  title,\n  onPress,\n  variant = 'primary',\n  disabled = false,\n}: ButtonProps) {\n  const scale = useSharedValue(1)\n\n  const animatedStyle = useAnimatedStyle(() => ({\n    transform: [{ scale: scale.value }],\n  }))\n\n  const handlePressIn = () => {\n    scale.value = withSpring(0.95)\n    if (Platform.OS !== 'web') {\n      Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)\n    }\n  }\n\n  const handlePressOut = () => {\n    scale.value = withSpring(1)\n  }\n\n  return (\n    \u003CAnimatedPressable\n      onPress={onPress}\n      onPressIn={handlePressIn}\n      onPressOut={handlePressOut}\n      disabled={disabled}\n      style={[\n        styles.button,\n        styles[variant],\n        disabled && styles.disabled,\n        animatedStyle,\n      ]}\n    >\n      \u003CText style={[styles.text, styles[`${variant}Text`]]}>{title}\u003C\u002FText>\n    \u003C\u002FAnimatedPressable>\n  )\n}\n\n\u002F\u002F Platform-specific files\n\u002F\u002F Button.ios.tsx - iOS-specific implementation\n\u002F\u002F Button.android.tsx - Android-specific implementation\n\u002F\u002F Button.web.tsx - Web-specific implementation\n\n\u002F\u002F Or use Platform.select\nconst styles = StyleSheet.create({\n  button: {\n    paddingVertical: 12,\n    paddingHorizontal: 24,\n    borderRadius: 8,\n    alignItems: 'center',\n    ...Platform.select({\n      ios: {\n        shadowColor: '#000',\n        shadowOffset: { width: 0, height: 2 },\n        shadowOpacity: 0.1,\n        shadowRadius: 4,\n      },\n      android: {\n        elevation: 4,\n      },\n    }),\n  },\n  primary: {\n    backgroundColor: '#007AFF',\n  },\n  secondary: {\n    backgroundColor: '#5856D6',\n  },\n  outline: {\n    backgroundColor: 'transparent',\n    borderWidth: 1,\n    borderColor: '#007AFF',\n  },\n  disabled: {\n    opacity: 0.5,\n  },\n  text: {\n    fontSize: 16,\n    fontWeight: '600',\n  },\n  primaryText: {\n    color: '#FFFFFF',\n  },\n  secondaryText: {\n    color: '#FFFFFF',\n  },\n  outlineText: {\n    color: '#007AFF',\n  },\n})\n```\n\n### Pattern 6: Performance Optimization\n\n```typescript\n\u002F\u002F components\u002FProductList.tsx\nimport { FlashList } from '@shopify\u002Fflash-list'\nimport { memo, useCallback } from 'react'\n\ninterface ProductListProps {\n  products: Product[]\n  onProductPress: (id: string) => void\n}\n\n\u002F\u002F Memoize list item\nconst ProductItem = memo(function ProductItem({\n  item,\n  onPress,\n}: {\n  item: Product\n  onPress: (id: string) => void\n}) {\n  const handlePress = useCallback(() => onPress(item.id), [item.id, onPress])\n\n  return (\n    \u003CPressable onPress={handlePress} style={styles.item}>\n      \u003CFastImage\n        source={{ uri: item.image }}\n        style={styles.image}\n        resizeMode=\"cover\"\n      \u002F>\n      \u003CText style={styles.title}>{item.name}\u003C\u002FText>\n      \u003CText style={styles.price}>${item.price}\u003C\u002FText>\n    \u003C\u002FPressable>\n  )\n})\n\nexport function ProductList({ products, onProductPress }: ProductListProps) {\n  const renderItem = useCallback(\n    ({ item }: { item: Product }) => (\n      \u003CProductItem item={item} onPress={onProductPress} \u002F>\n    ),\n    [onProductPress]\n  )\n\n  const keyExtractor = useCallback((item: Product) => item.id, [])\n\n  return (\n    \u003CFlashList\n      data={products}\n      renderItem={renderItem}\n      keyExtractor={keyExtractor}\n      estimatedItemSize={100}\n      \u002F\u002F Performance optimizations\n      removeClippedSubviews={true}\n      maxToRenderPerBatch={10}\n      windowSize={5}\n      \u002F\u002F Pull to refresh\n      onRefresh={onRefresh}\n      refreshing={isRefreshing}\n    \u002F>\n  )\n}\n```\n\n## EAS Build & Submit\n\n```json\n\u002F\u002F eas.json\n{\n  \"cli\": { \"version\": \">= 5.0.0\" },\n  \"build\": {\n    \"development\": {\n      \"developmentClient\": true,\n      \"distribution\": \"internal\",\n      \"ios\": { \"simulator\": true }\n    },\n    \"preview\": {\n      \"distribution\": \"internal\",\n      \"android\": { \"buildType\": \"apk\" }\n    },\n    \"production\": {\n      \"autoIncrement\": true\n    }\n  },\n  \"submit\": {\n    \"production\": {\n      \"ios\": { \"appleId\": \"your@email.com\", \"ascAppId\": \"123456789\" },\n      \"android\": { \"serviceAccountKeyPath\": \".\u002Fgoogle-services.json\" }\n    }\n  }\n}\n```\n\n```bash\n# Build commands\neas build --platform ios --profile development\neas build --platform android --profile preview\neas build --platform all --profile production\n\n# Submit to stores\neas submit --platform ios\neas submit --platform android\n\n# OTA updates\neas update --branch production --message \"Bug fixes\"\n```\n\n## Best Practices\n\n### Do's\n\n- **Use Expo** - Faster development, OTA updates, managed native code\n- **FlashList over FlatList** - Better performance for long lists\n- **Memoize components** - Prevent unnecessary re-renders\n- **Use Reanimated** - 60fps animations on native thread\n- **Test on real devices** - Simulators miss real-world issues\n\n### Don'ts\n\n- **Don't inline styles** - Use StyleSheet.create for performance\n- **Don't fetch in render** - Use useEffect or React Query\n- **Don't ignore platform differences** - Test on both iOS and Android\n- **Don't store secrets in code** - Use environment variables\n- **Don't skip error boundaries** - Mobile crashes are unforgiving\n",{"name":5,"description":7},"main","900bb95bbe72cdb94af6f5a620aa5081264b7b6d",".claude\u002Fmarketplaces\u002Fwshobson\u002Fplugins\u002Ffrontend-mobile-development\u002Fskills\u002Freact-native-architecture",0,"https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up#readme","https:\u002F\u002Fgithub.com\u002Fsteph-frtech","2026-05-16 00:03:30",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add steph-frtech\u002Fclaude-code-up --skill react-native-architecture",{"tool":37,"command":38},"bunx","bunx skills add steph-frtech\u002Fclaude-code-up --skill react-native-architecture",{"tool":40,"command":41},"pnpm","pnpm dlx skills add steph-frtech\u002Fclaude-code-up --skill react-native-architecture","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fmarketplaces\u002Fwshobson\u002Fplugins\u002Ffrontend-mobile-development\u002Fskills\u002Freact-native-architecture\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M72Y1BY6X8TX3DS19Y04NEBQ","example","One-line summary of what this skill does","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002Fskills\u002Fexample\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M72Y1A38EYR8S9P1MBYDAQTW","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsuperpowers__writing-plans\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M72Y174QSV1B5NV1E4KWHQBR","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsuperpowers__using-git-worktrees\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M72Y14SQRHHMKG316HGB2CGK","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsuperpowers__test-driven-development\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M72Y127BCPRH3BRKPJC3Q3G2","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsuperpowers__systematic-debugging\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M72Y1090GJA6B67KPD60WPHH","subagent-driven-development","Use when executing implementation plans with independent tasks in the current session","https:\u002F\u002Fgithub.com\u002Fsteph-frtech\u002Fclaude-code-up\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsuperpowers__subagent-driven-development\u002FSKILL.md",[],[]]