[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F0QXW5GG37M5YYST64K6VZ":3,"skill-same:01M7F0QXW5GG37M5YYST64K6VZ":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7F0QXW5GG37M5YYST64K6VZ","react-native-patterns",null,"React Native and Expo app patterns — Expo Router navigation, state separation (server\u002Fclient\u002Froute\u002Fform), TanStack Query data fetching with Zod, performant lists, NativeWind\u002FStyleSheet styling, native APIs, and secure storage. Use when building or editing React Native \u002F Expo screens, components, navigation, or data layers.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Freact-native-patterns\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: react-native-patterns\ndescription: React Native and Expo app patterns — Expo Router navigation, state separation (server\u002Fclient\u002Froute\u002Fform), TanStack Query data fetching with Zod, performant lists, NativeWind\u002FStyleSheet styling, native APIs, and secure storage. Use when building or editing React Native \u002F Expo screens, components, navigation, or data layers.\norigin: ECC\n---\n\n# React Native \u002F Expo Patterns\n\nPractical patterns for building production React Native apps with Expo. Covers navigation, state, data fetching, lists, styling, and native APIs. Pairs with the `rules\u002Freact-native\u002F` ruleset: rules say *what* to enforce, this skill shows *how*.\n\nLibraries named below (NativeWind, Zustand\u002FJotai, TanStack Query) are common, well-established options shown for illustration — the patterns matter more than the specific package, and any equivalent works. Zod is used for validation to stay consistent with ECC's existing `typescript\u002F` rules.\n\nThese patterns assume the managed Expo workflow (Expo Router, EAS, `expo-*` modules) on the New Architecture (the default in recent Expo SDKs, mandatory from SDK 55+). They do NOT assume the browser DOM — React Native has no `\u003Cdiv>`, no URL bar, and no web data-fetching defaults.\n\n## When to Activate\n\nUse this skill when:\n\n- Building or editing React Native \u002F Expo screens, components, or navigation\n- Setting up routing with Expo Router (file-based `app\u002F` directory)\n- Deciding where state belongs (server cache vs client store vs route params vs form)\n- Wiring data fetching with TanStack Query and validating responses with Zod\n- Rendering long or heavy lists\n- Choosing or applying a styling approach (NativeWind or StyleSheet)\n- Accessing native device APIs (camera, location, notifications) or secure storage\n- Reviewing RN code for mobile-specific issues\n\nDo NOT use the web\u002FReact-DOM patterns here — URL-as-state, `\u003Cdiv>`, and SWR-for-browser do not apply to React Native.\n\n## Core Concepts\n\n### Project structure (Expo Router)\n\nFile-based routing under `app\u002F`. Keep route files thin: they read and validate params, then delegate to a screen component that lives in `components\u002F` or `features\u002F`.\n\n```\napp\u002F\n  _layout.tsx          # root stack\n  (tabs)\u002F\n    _layout.tsx        # tab navigator\n    index.tsx          # Home\n  user\u002F[id].tsx        # dynamic route\ncomponents\u002F\nfeatures\u002F\n  user\u002FUserProfile.tsx\n```\n\n### Navigation: validate route params\n\nDeep links and dynamic routes deliver untrusted strings. Validate them with Zod before use.\n\n```tsx\n\u002F\u002F app\u002Fuser\u002F[id].tsx\nimport { useLocalSearchParams, router } from 'expo-router'\nimport { z } from 'zod'\nimport { UserProfile } from '@\u002Ffeatures\u002Fuser\u002FUserProfile'\n\nconst Params = z.object({ id: z.string().uuid() })\n\nexport default function UserRoute() {\n  const parsed = Params.safeParse(useLocalSearchParams())\n  if (!parsed.success) {\n    router.replace('\u002Fnot-found')\n    return null\n  }\n  return \u003CUserProfile userId={parsed.data.id} \u002F>\n}\n```\n\n### State: keep concerns separate\n\nDo not duplicate server data into a client store. Each concern has its own home.\n\n| Concern | Common choices |\n|---------|------|\n| Server state (remote data) | a server-cache library (TanStack Query, SWR) |\n| Client\u002FUI state | a lightweight store (Zustand, Jotai) or Context |\n| Route\u002Fnavigation state | Expo Router params |\n| Form state | a form library (e.g. React Hook Form) + schema validation |\n| Secrets \u002F tokens | `expo-secure-store` |\n| Non-secret persistence | `AsyncStorage` \u002F MMKV |\n\nPrefer local `useState` until state genuinely needs sharing.\n\n### Data fetching: a cache library + Zod\n\nUse a server-cache library (TanStack Query, SWR) instead of fetch-in-`useEffect`. Validate at the boundary and infer types from the schema. Handle loading, error, and empty states explicitly. (Example uses TanStack Query.)\n\n```tsx\nimport { useQuery, useMutation, useQueryClient } from '@tanstack\u002Freact-query'\nimport { z } from 'zod'\n\nconst User = z.object({ id: z.string(), email: z.string().email() })\ntype User = z.infer\u003Ctypeof User>\n\nexport function useUser(id: string) {\n  return useQuery({\n    queryKey: ['user', id],\n    queryFn: async (): Promise\u003CUser> => User.parse(await api.getUser(id)),\n  })\n}\n\nexport function useUpdateEmail(id: string) {\n  const qc = useQueryClient()\n  return useMutation({\n    mutationFn: (email: string) => api.updateEmail(id, email),\n    onSuccess: () => qc.invalidateQueries({ queryKey: ['user', id] }),\n  })\n}\n```\n\n### Lists: virtualize, never map a big array in a ScrollView\n\n```tsx\nimport { FlatList } from 'react-native'\n\n\u003CFlatList\n  data={items}\n  keyExtractor={(item) => item.id}\n  renderItem={renderItem}          \u002F\u002F memoized\n  initialNumToRender={10}\n  windowSize={5}\n\u002F>\n```\n\nUse `FlashList` (Shopify) for large or heterogeneous lists.\n\n### Styling: pick one system\n\n`StyleSheet.create()` is the framework-native option; utility-class libraries (e.g. NativeWind) are a common alternative. Choose one and stay consistent. Never build style objects inline in JSX on hot paths.\n\n```tsx\n\u002F\u002F NativeWind\n\u003CView className=\"p-4 rounded-2xl bg-white\">\n  \u003CText className=\"text-base font-semibold\">Hello\u003C\u002FText>\n\u003C\u002FView>\n\n\u002F\u002F StyleSheet\nconst styles = StyleSheet.create({ card: { padding: 16, borderRadius: 16, backgroundColor: '#fff' } })\n\u003CView style={styles.card}>...\u003C\u002FView>\n```\n\n### Native APIs: wrap in hooks, clean up effects\n\nKeep Expo SDK calls and subscriptions inside `use*` hooks, not in JSX. Always clean up.\n\n```tsx\nimport { useEffect, useState } from 'react'\nimport * as Location from 'expo-location'\n\ntype LocationState =\n  | { status: 'loading' }\n  | { status: 'denied' }\n  | { status: 'granted'; coords: Location.LocationObjectCoords }\n\nexport function useCurrentLocation() {\n  \u002F\u002F Track status, not just coords — so the UI can tell \"still loading\" apart\n  \u002F\u002F from \"permission denied\" and show an actionable message.\n  const [state, setState] = useState\u003CLocationState>({ status: 'loading' })\n\n  useEffect(() => {\n    let active = true\n    ;(async () => {\n      const { status } = await Location.requestForegroundPermissionsAsync()\n      if (status !== 'granted') {\n        if (active) setState({ status: 'denied' })\n        return\n      }\n      const pos = await Location.getCurrentPositionAsync({})\n      if (active) setState({ status: 'granted', coords: pos.coords })\n    })()\n    return () => { active = false }   \u002F\u002F ignore stale result after unmount\n  }, [])\n\n  return state\n}\n```\n\n### Secure storage for tokens\n\n```tsx\nimport * as SecureStore from 'expo-secure-store'\n\nawait SecureStore.setItemAsync('auth_token', token)   \u002F\u002F Keychain \u002F Keystore\nconst token = await SecureStore.getItemAsync('auth_token')\n```\n\n## Code Examples\n\n### A full screen: route → query → list → states\n\n```tsx\n\u002F\u002F app\u002F(tabs)\u002Forders.tsx\nimport { memo, useCallback } from 'react'\nimport { FlatList, Text, View } from 'react-native'\nimport { useQuery } from '@tanstack\u002Freact-query'\nimport { z } from 'zod'\n\nconst OrderSchema = z.object({ id: z.string(), total: z.number(), status: z.string() })\nconst OrdersSchema = z.array(OrderSchema)\ntype Order = z.infer\u003Ctypeof OrderSchema>\n\nfunction useOrders() {\n  return useQuery({\n    queryKey: ['orders'],\n    queryFn: async () => OrdersSchema.parse(await api.listOrders()),\n  })\n}\n\n\u002F\u002F Memoized so its reference is stable across renders (see the lists guidance).\nconst OrderRow = memo(function OrderRow({ item }: { item: Order }) {\n  return (\n    \u003CView className=\"px-4 py-3 border-b border-neutral-200\">\n      \u003CText className=\"font-medium\">#{item.id}\u003C\u002FText>\n      \u003CText className=\"text-neutral-500\">{item.status} · ${item.total}\u003C\u002FText>\n    \u003C\u002FView>\n  )\n})\n\nexport default function OrdersScreen() {\n  const { data, isLoading, isError, refetch, isRefetching } = useOrders()\n  const renderItem = useCallback(({ item }: { item: Order }) => \u003COrderRow item={item} \u002F>, [])\n\n  if (isLoading) return \u003CCentered>\u003CText>Loading…\u003C\u002FText>\u003C\u002FCentered>\n  if (isError) return \u003CCentered>\u003CText accessibilityRole=\"alert\">Could not load orders.\u003C\u002FText>\u003C\u002FCentered>\n  if (!data?.length) return \u003CCentered>\u003CText>No orders yet.\u003C\u002FText>\u003C\u002FCentered>\n\n  return (\n    \u003CFlatList\n      data={data}\n      keyExtractor={(o) => o.id}\n      onRefresh={refetch}\n      refreshing={isRefetching}\n      renderItem={renderItem}\n    \u002F>\n  )\n}\n```\n\n### A form: React Hook Form + Zod resolver\n\n```tsx\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform\u002Fresolvers\u002Fzod'\nimport { z } from 'zod'\nimport { TextInput, Button, Text } from 'react-native'\n\nconst Schema = z.object({ email: z.string().email('Invalid email') })\ntype FormValues = z.infer\u003Ctypeof Schema>\n\nexport function EmailForm({ onSubmit }: { onSubmit: (v: FormValues) => void }) {\n  const { control, handleSubmit, formState: { errors } } = useForm\u003CFormValues>({\n    resolver: zodResolver(Schema),\n    defaultValues: { email: '' },\n  })\n\n  return (\n    \u003C>\n      \u003CController\n        control={control}\n        name=\"email\"\n        render={({ field: { value, onChange, onBlur } }) => (\n          \u003CTextInput\n            value={value}\n            onChangeText={onChange}\n            onBlur={onBlur}\n            autoCapitalize=\"none\"\n            keyboardType=\"email-address\"\n            accessibilityLabel=\"Email address\"\n          \u002F>\n        )}\n      \u002F>\n      {errors.email && \u003CText accessibilityRole=\"alert\">{errors.email.message}\u003C\u002FText>}\n      \u003CButton title=\"Save\" onPress={handleSubmit(onSubmit)} \u002F>\n    \u003C\u002F>\n  )\n}\n```\n\n## Anti-Patterns\n\n```tsx\n\u002F\u002F WRONG: large array mapped inside a ScrollView (no virtualization, janky, high memory)\n\u003CScrollView>{items.map((i) => \u003CRow key={i.id} item={i} \u002F>)}\u003C\u002FScrollView>\n\u002F\u002F RIGHT: FlatList \u002F FlashList\n\n\u002F\u002F WRONG: server data copied into a client store (two sources of truth, stale data)\nconst useStore = create((set) => ({ users: [], setUsers: (u) => set({ users: u }) }))\nuseEffect(() => { getUsers().then(setUsers) }, [])\n\u002F\u002F RIGHT: useQuery owns server state; derive what you need\n\n\u002F\u002F WRONG: tokens in AsyncStorage (not encrypted)\nawait AsyncStorage.setItem('auth_token', token)\n\u002F\u002F RIGHT: expo-secure-store\n\n\u002F\u002F WRONG: trusting deep-link params\nconst { id } = useLocalSearchParams(); fetchUser(id)\n\u002F\u002F RIGHT: validate with Zod before use\n\n\u002F\u002F WRONG: inline style object recreated every render on a hot path\n\u003CView style={{ padding: 16, backgroundColor: '#fff' }} \u002F>\n\u002F\u002F RIGHT: StyleSheet.create at module scope, or NativeWind className\n\n\u002F\u002F WRONG: real secret shipped in the bundle\nconst STRIPE_SECRET = 'sk_live_...'\n\u002F\u002F RIGHT: keep privileged calls server-side; ship only public keys protected by backend rules\n```\n\n## Best Practices\n\n- Keep route files thin; put logic in screen components and `use*` hooks.\n- Validate every external input (API responses, route params, push payloads) with Zod.\n- Let TanStack Query own server state; keep client stores small.\n- Always render loading, error, and empty states — never just a spinner with no fallback.\n- Virtualize lists; memoize `renderItem`; provide a stable `keyExtractor`.\n- Use `react-native-reanimated` for animation (UI thread); avoid heavy work on the JS thread.\n- Store tokens in `expo-secure-store`; never trust the client for authorization.\n- Respect safe areas, Dynamic Type, and accessibility roles\u002Flabels from the start.\n- Confirm New Architecture compatibility for every native dependency before release.\n\n## Related Skills\n\n- `frontend-patterns` — React\u002FNext.js (web) patterns; useful for shared React concepts, but DOM-specific.\n- `coding-standards` — TypeScript\u002FJavaScript idioms that apply to RN code.\n- `tdd-workflow`, `e2e-testing` — testing process (use Jest + React Native Testing Library, Maestro\u002FDetox for RN).\n- `security-review` — general security checklist that complements the RN bundle\u002Fsecret guidance above.\n","# React Native \u002F Expo Patterns\n\nPractical patterns for building production React Native apps with Expo. Covers navigation, state, data fetching, lists, styling, and native APIs. Pairs with the `rules\u002Freact-native\u002F` ruleset: rules say *what* to enforce, this skill shows *how*.\n\nLibraries named below (NativeWind, Zustand\u002FJotai, TanStack Query) are common, well-established options shown for illustration — the patterns matter more than the specific package, and any equivalent works. Zod is used for validation to stay consistent with ECC's existing `typescript\u002F` rules.\n\nThese patterns assume the managed Expo workflow (Expo Router, EAS, `expo-*` modules) on the New Architecture (the default in recent Expo SDKs, mandatory from SDK 55+). They do NOT assume the browser DOM — React Native has no `\u003Cdiv>`, no URL bar, and no web data-fetching defaults.\n\n## When to Activate\n\nUse this skill when:\n\n- Building or editing React Native \u002F Expo screens, components, or navigation\n- Setting up routing with Expo Router (file-based `app\u002F` directory)\n- Deciding where state belongs (server cache vs client store vs route params vs form)\n- Wiring data fetching with TanStack Query and validating responses with Zod\n- Rendering long or heavy lists\n- Choosing or applying a styling approach (NativeWind or StyleSheet)\n- Accessing native device APIs (camera, location, notifications) or secure storage\n- Reviewing RN code for mobile-specific issues\n\nDo NOT use the web\u002FReact-DOM patterns here — URL-as-state, `\u003Cdiv>`, and SWR-for-browser do not apply to React Native.\n\n## Core Concepts\n\n### Project structure (Expo Router)\n\nFile-based routing under `app\u002F`. Keep route files thin: they read and validate params, then delegate to a screen component that lives in `components\u002F` or `features\u002F`.\n\n```\napp\u002F\n  _layout.tsx          # root stack\n  (tabs)\u002F\n    _layout.tsx        # tab navigator\n    index.tsx          # Home\n  user\u002F[id].tsx        # dynamic route\ncomponents\u002F\nfeatures\u002F\n  user\u002FUserProfile.tsx\n```\n\n### Navigation: validate route params\n\nDeep links and dynamic routes deliver untrusted strings. Validate them with Zod before use.\n\n```tsx\n\u002F\u002F app\u002Fuser\u002F[id].tsx\nimport { useLocalSearchParams, router } from 'expo-router'\nimport { z } from 'zod'\nimport { UserProfile } from '@\u002Ffeatures\u002Fuser\u002FUserProfile'\n\nconst Params = z.object({ id: z.string().uuid() })\n\nexport default function UserRoute() {\n  const parsed = Params.safeParse(useLocalSearchParams())\n  if (!parsed.success) {\n    router.replace('\u002Fnot-found')\n    return null\n  }\n  return \u003CUserProfile userId={parsed.data.id} \u002F>\n}\n```\n\n### State: keep concerns separate\n\nDo not duplicate server data into a client store. Each concern has its own home.\n\n| Concern | Common choices |\n|---------|------|\n| Server state (remote data) | a server-cache library (TanStack Query, SWR) |\n| Client\u002FUI state | a lightweight store (Zustand, Jotai) or Context |\n| Route\u002Fnavigation state | Expo Router params |\n| Form state | a form library (e.g. React Hook Form) + schema validation |\n| Secrets \u002F tokens | `expo-secure-store` |\n| Non-secret persistence | `AsyncStorage` \u002F MMKV |\n\nPrefer local `useState` until state genuinely needs sharing.\n\n### Data fetching: a cache library + Zod\n\nUse a server-cache library (TanStack Query, SWR) instead of fetch-in-`useEffect`. Validate at the boundary and infer types from the schema. Handle loading, error, and empty states explicitly. (Example uses TanStack Query.)\n\n```tsx\nimport { useQuery, useMutation, useQueryClient } from '@tanstack\u002Freact-query'\nimport { z } from 'zod'\n\nconst User = z.object({ id: z.string(), email: z.string().email() })\ntype User = z.infer\u003Ctypeof User>\n\nexport function useUser(id: string) {\n  return useQuery({\n    queryKey: ['user', id],\n    queryFn: async (): Promise\u003CUser> => User.parse(await api.getUser(id)),\n  })\n}\n\nexport function useUpdateEmail(id: string) {\n  const qc = useQueryClient()\n  return useMutation({\n    mutationFn: (email: string) => api.updateEmail(id, email),\n    onSuccess: () => qc.invalidateQueries({ queryKey: ['user', id] }),\n  })\n}\n```\n\n### Lists: virtualize, never map a big array in a ScrollView\n\n```tsx\nimport { FlatList } from 'react-native'\n\n\u003CFlatList\n  data={items}\n  keyExtractor={(item) => item.id}\n  renderItem={renderItem}          \u002F\u002F memoized\n  initialNumToRender={10}\n  windowSize={5}\n\u002F>\n```\n\nUse `FlashList` (Shopify) for large or heterogeneous lists.\n\n### Styling: pick one system\n\n`StyleSheet.create()` is the framework-native option; utility-class libraries (e.g. NativeWind) are a common alternative. Choose one and stay consistent. Never build style objects inline in JSX on hot paths.\n\n```tsx\n\u002F\u002F NativeWind\n\u003CView className=\"p-4 rounded-2xl bg-white\">\n  \u003CText className=\"text-base font-semibold\">Hello\u003C\u002FText>\n\u003C\u002FView>\n\n\u002F\u002F StyleSheet\nconst styles = StyleSheet.create({ card: { padding: 16, borderRadius: 16, backgroundColor: '#fff' } })\n\u003CView style={styles.card}>...\u003C\u002FView>\n```\n\n### Native APIs: wrap in hooks, clean up effects\n\nKeep Expo SDK calls and subscriptions inside `use*` hooks, not in JSX. Always clean up.\n\n```tsx\nimport { useEffect, useState } from 'react'\nimport * as Location from 'expo-location'\n\ntype LocationState =\n  | { status: 'loading' }\n  | { status: 'denied' }\n  | { status: 'granted'; coords: Location.LocationObjectCoords }\n\nexport function useCurrentLocation() {\n  \u002F\u002F Track status, not just coords — so the UI can tell \"still loading\" apart\n  \u002F\u002F from \"permission denied\" and show an actionable message.\n  const [state, setState] = useState\u003CLocationState>({ status: 'loading' })\n\n  useEffect(() => {\n    let active = true\n    ;(async () => {\n      const { status } = await Location.requestForegroundPermissionsAsync()\n      if (status !== 'granted') {\n        if (active) setState({ status: 'denied' })\n        return\n      }\n      const pos = await Location.getCurrentPositionAsync({})\n      if (active) setState({ status: 'granted', coords: pos.coords })\n    })()\n    return () => { active = false }   \u002F\u002F ignore stale result after unmount\n  }, [])\n\n  return state\n}\n```\n\n### Secure storage for tokens\n\n```tsx\nimport * as SecureStore from 'expo-secure-store'\n\nawait SecureStore.setItemAsync('auth_token', token)   \u002F\u002F Keychain \u002F Keystore\nconst token = await SecureStore.getItemAsync('auth_token')\n```\n\n## Code Examples\n\n### A full screen: route → query → list → states\n\n```tsx\n\u002F\u002F app\u002F(tabs)\u002Forders.tsx\nimport { memo, useCallback } from 'react'\nimport { FlatList, Text, View } from 'react-native'\nimport { useQuery } from '@tanstack\u002Freact-query'\nimport { z } from 'zod'\n\nconst OrderSchema = z.object({ id: z.string(), total: z.number(), status: z.string() })\nconst OrdersSchema = z.array(OrderSchema)\ntype Order = z.infer\u003Ctypeof OrderSchema>\n\nfunction useOrders() {\n  return useQuery({\n    queryKey: ['orders'],\n    queryFn: async () => OrdersSchema.parse(await api.listOrders()),\n  })\n}\n\n\u002F\u002F Memoized so its reference is stable across renders (see the lists guidance).\nconst OrderRow = memo(function OrderRow({ item }: { item: Order }) {\n  return (\n    \u003CView className=\"px-4 py-3 border-b border-neutral-200\">\n      \u003CText className=\"font-medium\">#{item.id}\u003C\u002FText>\n      \u003CText className=\"text-neutral-500\">{item.status} · ${item.total}\u003C\u002FText>\n    \u003C\u002FView>\n  )\n})\n\nexport default function OrdersScreen() {\n  const { data, isLoading, isError, refetch, isRefetching } = useOrders()\n  const renderItem = useCallback(({ item }: { item: Order }) => \u003COrderRow item={item} \u002F>, [])\n\n  if (isLoading) return \u003CCentered>\u003CText>Loading…\u003C\u002FText>\u003C\u002FCentered>\n  if (isError) return \u003CCentered>\u003CText accessibilityRole=\"alert\">Could not load orders.\u003C\u002FText>\u003C\u002FCentered>\n  if (!data?.length) return \u003CCentered>\u003CText>No orders yet.\u003C\u002FText>\u003C\u002FCentered>\n\n  return (\n    \u003CFlatList\n      data={data}\n      keyExtractor={(o) => o.id}\n      onRefresh={refetch}\n      refreshing={isRefetching}\n      renderItem={renderItem}\n    \u002F>\n  )\n}\n```\n\n### A form: React Hook Form + Zod resolver\n\n```tsx\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform\u002Fresolvers\u002Fzod'\nimport { z } from 'zod'\nimport { TextInput, Button, Text } from 'react-native'\n\nconst Schema = z.object({ email: z.string().email('Invalid email') })\ntype FormValues = z.infer\u003Ctypeof Schema>\n\nexport function EmailForm({ onSubmit }: { onSubmit: (v: FormValues) => void }) {\n  const { control, handleSubmit, formState: { errors } } = useForm\u003CFormValues>({\n    resolver: zodResolver(Schema),\n    defaultValues: { email: '' },\n  })\n\n  return (\n    \u003C>\n      \u003CController\n        control={control}\n        name=\"email\"\n        render={({ field: { value, onChange, onBlur } }) => (\n          \u003CTextInput\n            value={value}\n            onChangeText={onChange}\n            onBlur={onBlur}\n            autoCapitalize=\"none\"\n            keyboardType=\"email-address\"\n            accessibilityLabel=\"Email address\"\n          \u002F>\n        )}\n      \u002F>\n      {errors.email && \u003CText accessibilityRole=\"alert\">{errors.email.message}\u003C\u002FText>}\n      \u003CButton title=\"Save\" onPress={handleSubmit(onSubmit)} \u002F>\n    \u003C\u002F>\n  )\n}\n```\n\n## Anti-Patterns\n\n```tsx\n\u002F\u002F WRONG: large array mapped inside a ScrollView (no virtualization, janky, high memory)\n\u003CScrollView>{items.map((i) => \u003CRow key={i.id} item={i} \u002F>)}\u003C\u002FScrollView>\n\u002F\u002F RIGHT: FlatList \u002F FlashList\n\n\u002F\u002F WRONG: server data copied into a client store (two sources of truth, stale data)\nconst useStore = create((set) => ({ users: [], setUsers: (u) => set({ users: u }) }))\nuseEffect(() => { getUsers().then(setUsers) }, [])\n\u002F\u002F RIGHT: useQuery owns server state; derive what you need\n\n\u002F\u002F WRONG: tokens in AsyncStorage (not encrypted)\nawait AsyncStorage.setItem('auth_token', token)\n\u002F\u002F RIGHT: expo-secure-store\n\n\u002F\u002F WRONG: trusting deep-link params\nconst { id } = useLocalSearchParams(); fetchUser(id)\n\u002F\u002F RIGHT: validate with Zod before use\n\n\u002F\u002F WRONG: inline style object recreated every render on a hot path\n\u003CView style={{ padding: 16, backgroundColor: '#fff' }} \u002F>\n\u002F\u002F RIGHT: StyleSheet.create at module scope, or NativeWind className\n\n\u002F\u002F WRONG: real secret shipped in the bundle\nconst STRIPE_SECRET = 'sk_live_...'\n\u002F\u002F RIGHT: keep privileged calls server-side; ship only public keys protected by backend rules\n```\n\n## Best Practices\n\n- Keep route files thin; put logic in screen components and `use*` hooks.\n- Validate every external input (API responses, route params, push payloads) with Zod.\n- Let TanStack Query own server state; keep client stores small.\n- Always render loading, error, and empty states — never just a spinner with no fallback.\n- Virtualize lists; memoize `renderItem`; provide a stable `keyExtractor`.\n- Use `react-native-reanimated` for animation (UI thread); avoid heavy work on the JS thread.\n- Store tokens in `expo-secure-store`; never trust the client for authorization.\n- Respect safe areas, Dynamic Type, and accessibility roles\u002Flabels from the start.\n- Confirm New Architecture compatibility for every native dependency before release.\n\n## Related Skills\n\n- `frontend-patterns` — React\u002FNext.js (web) patterns; useful for shared React concepts, but DOM-specific.\n- `coding-standards` — TypeScript\u002FJavaScript idioms that apply to RN code.\n- `tdd-workflow`, `e2e-testing` — testing process (use Jest + React Native Testing Library, Maestro\u002FDetox for RN).\n- `security-review` — general security checklist that complements the RN bundle\u002Fsecret guidance above.\n",{"name":5,"origin":24,"description":7},"ECC","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fecc\u002Freact-native-patterns","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill react-native-patterns",{"tool":37,"command":38},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill react-native-patterns",{"tool":40,"command":41},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill react-native-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fecc\u002Freact-native-patterns\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":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]