React Native + Expo
CLAUDE.md for React Native + Expo
Score: 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`.
These examples are released under CC0. Use them freely, no attribution required. They are provided as is, without warranty of any kind: review and adapt them to your project before use, as you are responsible for the outcome of applying them.
Bring PromptArch to your team
Deploy PromptArch as an internal tool across every area of your company. Get team accounts with shared preloaded credits and custom domains tailored to your organization.
Contact Us