[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71NQ1KPXRT29RVVHFTTMHZM":3,"skill-same:01M71NQ1KPXRT29RVVHFTTMHZM":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":54,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":6,"updatedAt":57,"install":58,"resources":71},"01M71NQ1KPXRT29RVVHFTTMHZM","react-native-patterns",null,"Use when writing or reviewing Expo React Native screens: Expo Router, state placement, TanStack Query with Zod, lists, NativeWind and native APIs. A patterns catalogue; for an end-to-end build and debug persona, use react-native-expert.","monoes\u002Fmonomind","monoes","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F276744696?v=4","01M71KWF37AJ2NJBP3KWBVSDGT","01M71KWF4CSF8ADH0M6HA09VD2",23,"MIT","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Freact-native-patterns\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Freact-native-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"react native","native","react native patterns","patterns","react","expo router","expo","react-native","typescript","mobile","router","query","when","writing","persona","frontend","end","expert","tanstack query","zod","2026-11-10 10:56:23",false,"---\nname: react-native-patterns\ndescription: \"Use when writing or reviewing Expo React Native screens: Expo Router, state placement, TanStack Query with Zod, lists, NativeWind and native APIs. A patterns catalogue; for an end-to-end build and debug persona, use react-native-expert.\"\ntags: [\"mobile\",\"frontend\",\"react-native\",\"typescript\"]\ntools: []\nlicense: MIT\nsource: https:\u002F\u002Fgithub.com\u002Faffaan-m\u002FECC\nsource_path: \"skills\u002Freact-native-patterns\"\nsource_commit: bf70150eb2df8070024e5bdf08e4aa08959e2735\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,"tags":44,"tools":45,"source":46,"license":14,"description":7,"source_path":47,"source_commit":48},[28,34,26,27],[],"https:\u002F\u002Fgithub.com\u002Faffaan-m\u002FECC","skills\u002Freact-native-patterns","bf70150eb2df8070024e5bdf08e4aa08959e2735","main","f7cd4595d0f8959822163e14f9787117765c931a","packages\u002F@monomind\u002Fcli\u002Forg-skills\u002Freact-native-patterns",2,"https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind","https:\u002F\u002Fmonoes.github.io\u002Fmonomind\u002F","https:\u002F\u002Fgithub.com\u002Fmonoes","https:\u002F\u002Fmonoes.me","2026-11-14 03:30:52",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add monoes\u002Fmonomind --skill react-native-patterns",{"tool":64,"command":65},"bunx","bunx skills add monoes\u002Fmonomind --skill react-native-patterns",{"tool":67,"command":68},"pnpm","pnpm dlx skills add monoes\u002Fmonomind --skill react-native-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Freact-native-patterns\u002FSKILL.md",true,[72],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":15},"LICENSE.txt","LICENSE","许可证",1071,[78,87,96,104,112,120],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":82,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M73YHAZDWV4ZVTGSKMWQ4Z1S","isms-audit-expert","Use when planning or running an ISO 27001 ISMS audit: risk-based audit schedules, Annex A control assessment, Statement of Applicability and nonconformities. Auditor-side procedures, versus compliance-auditor, which is org role guidance across SOC 2, HIPAA and PCI-DSS.","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fisms-audit-expert\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fisms-audit-expert\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":86},"01M73YGBS2APTY71Y4CYA2DKSQ","instrument-data-to-allotrope","Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full ASM JSON, flattened CSV for easy import, and exportable Python code for data engineers. Common triggers include converting instrument files, standardizing lab data, preparing data for upload to LIMS\u002FELN systems, or generating parser code for production pipelines.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Finstrument-data-to-allotrope\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Finstrument-data-to-allotrope\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":86},"01M73YB23X4NP40R73TS6YY8TX","experiment-designer","Use when planning a product A\u002FB or multivariate test: If\u002FThen\u002FBecause hypotheses, primary and guardrail metrics, sample size and MDE, ICE prioritization. For logging and reproducing ML runs use experiment-tracker; for scientific study design use experimental-design.","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fexperiment-designer\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fexperiment-designer\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":86},"01M73Y8ETSB9072G5ZGPPR0X6E","digest","Generate a daily or weekly digest of activity across all connected sources. Use when catching up after time away, starting the day and wanting a summary of mentions and action items, or reviewing a week's decisions and document updates grouped by project.","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fdigest\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fdigest\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":91,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":86},"01M73Y7XJJBH0QXCM5GKJW6N21","design-critique","Get structured design feedback on usability, hierarchy, and consistency. Trigger with \"review this design\", \"critique this mockup\", \"what do you think of this screen?\", or when sharing a Figma link or screenshot for feedback at any stage from exploration to final polish.","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fdesign-critique\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fdesign-critique\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":86},"01M73Y7SM786ZEMNXGPT595AM3","deployment-pipeline-design","Use when architecting a multi-stage CI\u002FCD pipeline with approval gates, SAST and DAST scans, environment promotion, canary rollout and automated rollback. Design-level; for concrete Dockerfile and health check patterns use deployment-patterns.","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fdeployment-pipeline-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fmonoes\u002Fmonomind\u002Fblob\u002Fmain\u002Fpackages\u002F@monomind\u002Fcli\u002Forg-skills\u002Fdeployment-pipeline-design\u002FSKILL.md",[],[]]