React Native + Expo
CLAUDE.md for React Native + Expo
Nota: AA CLAUDE.md covering the prebuild workflow, platform-fork conventions, and the native-dependency gotchas that break hot reload.
# CLAUDE.md - Trailhead (React Native + Expo) ## Commands ```bash npx expo start # dev; i = iOS simulator, a = Android pnpm test -- ComposeScreen # single suite (full run is slow, avoid while iterating) pnpm lint && pnpm typecheck # CI gates npx expo prebuild --clean # only after native config changes in app.json ``` ## Architecture - Expo Router: file-based screens under `app/`; shared layouts in `_layout.tsx`. - Server cache is TanStack Query (`hooks/queries/`); client state is Zustand (`stores/`). Query data never gets copied into a store. - Native configuration lives in `app.json` + config plugins; `ios/` and `android/` are generated by prebuild. ## Conventions - Platform differences via `.ios.tsx` / `.android.tsx` file forks. - Styles co-located with `StyleSheet.create`; theme tokens from `theme/` - no hardcoded colors. - New screens follow `app/(tabs)/profile.tsx` for data loading and error states. ## Workflow - After changing any dependency with native code: `npx expo prebuild --clean`, then a fresh dev build - hot reload will lie to you until then. - Test on both simulators before marking UI work done; Android text rendering differs enough to break layouts. ## Do not - Do not import Node-only modules; this runs on Hermes. - Do not hand-edit `ios/` or `android/`; they are regenerated output. - Do not store tokens in AsyncStorage; use `expo-secure-store`.
Estes exemplos são publicados sob CC0. Use livremente, sem atribuição. São fornecidos como estão, sem garantia de qualquer tipo: revise e adapte ao seu projeto antes de usar, pois você é responsável pelo resultado de aplicá-los.
Leve o PromptArch para sua equipe
Implemente o PromptArch como ferramenta interna em todas as áreas da sua empresa. Obtenha contas de equipe com créditos pré-carregados compartilhados e domínios personalizados para sua organização.
Fale Conosco