BosskuAI Expo / React Native
Use this skill when building, auditing, or debugging a React Native app, with or without Expo, where the answer depends on native platform behavior rather than on React alone.
How this differs from nearby skills
bosskuai-react-development: React on the web; hooks and state advice carry over, DOM and routing advice does not.bosskuai-mobile-app-release: credentials, store review, rollouts, and OTA policy; this skill gets the app correct on device.bosskuai-api-design/ backend skills: the API the app calls.animate-expo(emil-skills): motion, gestures, sheets, and haptics, including the Reanimated and Gesture Handler code; this skill owns app structure, native behavior, and builds.
Mindset
- The device is the truth. Simulators hide permission prompts, memory pressure, slow networks, and real keyboards.
- Two threads: JS and UI. Anything that blocks JS drops frames; anything heavy belongs in worklets, native modules, or off the render path.
- Stay on managed Expo until a real native need appears; then add a config plugin or a development build, not a bare eject.
- Every permission is a product decision with a purpose string and a timing.
Orient before changing anything
npx expo-doctorandnpx expo install --check: SDK version, mismatched native dependencies. Since SDK 55 every Expo package's major version equals the SDK's, so a mismatch is easy to spot. Read the installed SDK and React Native frompackage.jsonand the lockfile (ornode_modules/expo/package.json), and check the latest withnpm view expo versionandnpm view react-native version(release notes: expo.dev/changelog and github.com/facebook/react-native/releases).app.json/app.config.ts: bundle id / package, scheme, permissions, plugins,runtimeVersionpolicy, Hermes, and on SDK 54 or older the New Architecture flag.eas.json: build profiles (development, preview, production), channels, env per profile.- Navigation: Expo Router (file-based, groups, layouts) or React Navigation; auth gating approach.
- Data and storage: TanStack Query, MMKV, SQLite/expo-sqlite, SecureStore; offline expectations. Before changing a query key or store, list every screen that reads it; ask the user which installed builds share its
runtimeVersion; done when both are known. - Expo Go vs development build: any custom native module, notification, or in-app purchase means a development build.
Rules that catch most React Native bugs
- Long lists:
FlashListorFlatListwith stable keys,getItemLayoutwhere sizes are fixed, never aScrollViewof hundreds of children. - Inline objects and functions on list items re-render every row; memoize row components and pass primitives.
- Reanimated: animation math in worklets (
useAnimatedStyle,useSharedValue); never read shared values on the JS thread inside render. - Gesture Handler needs
GestureHandlerRootViewat the root; nested gestures need explicitsimultaneousWithExternalGesture. - Safe areas via
react-native-safe-area-contextinsets, not hard-coded padding; notch, home indicator, and Android navigation bar differ. - Keyboard:
KeyboardAvoidingViewbehaviordiffers per platform; test with a real keyboard and a small screen. - Android hardware back: handle it in Expo Router or
BackHandler; do not trap the user. - Native navigation and reach: follow each platform's back behaviour, keep primary actions within thumb reach, handle safe areas, keyboard avoidance and orientation. See
../../references/playbooks/human-centered-design-playbook.md. - Lost state: Android can kill the app while the camera or Settings is open, so keep drafts in storage. iOS asks once; after a denial, send the user to Settings (
Linking.openSettings()). - Text must be inside
<Text>; layout uses flexbox withflexDirection: 'column'default. - Images:
expo-imagewith explicit sizes and caching; never decode large images on the JS side. - Secrets:
SecureStorefor tokens;AsyncStorage/MMKV only for non-sensitive data;EXPO_PUBLIC_*env is bundled into the app and is public by definition. - Networking: iOS ATS blocks plain HTTP; Android 9+ blocks cleartext unless configured. Retry with backoff; show offline state. A request that timed out may have succeeded on the server. Retry a POST or PATCH only when the API documents idempotency keys for that endpoint, and send the same key on every retry, within the window the API documents (Stripe may delete keys after 24 hours). PUT and DELETE are idempotent by definition, so they need no key.
- Deep links:
schemefor custom links, Universal Links (AASA) and App Links (assetlinks.json) for HTTPS; test cold start and warm start paths. - Notifications: request permission in context, not at launch; test on physical devices with production credentials; Android needs a channel.
- OTA (EAS Update): only JS and assets; any native change (new module, permission, SDK upgrade) requires a new build and a new
runtimeVersion. Every installed build with the sameruntimeVersiongets the update, including builds from months ago, so each update must still work with the oldest of them: keep the API backward compatible for it, or block old builds with a minimum-version check. - New Architecture: React Native 0.82 made it mandatory and SDK 54 is the last Expo SDK with a legacy option; SDK 55 (React Native 0.83) and every later SDK run the New Architecture only, and React Native removes more legacy classes each release. Before moving an app off SDK 54 or older, confirm every native library supports it; replace legacy-only modules instead of pinning the SDK. Fabric/TurboModules break old bridge-based modules. (Do not take a version from this file. Read the project's own SDK from
node_modules/expo/package.jsonor the lockfile, and the latest with thenpm viewcommands in step 1.) - Platform targets: Play requires a recent
targetSdkVersioneach year; Apple requires current Xcode SDK and privacy manifests for listed APIs.
Architecture that holds up
- Expo Router route groups:
(auth),(app); a root layout that redirects on session state; typed routes on. - Server state in TanStack Query persisted to MMKV for instant cold-start UI; mutations queued offline where the product needs it.
- Feature folders (
features/<name>/{components,hooks,api,schema}) with zod schemas shared with the backend when possible. - Theming through a single token module; i18n with
expo-localization+ i18next or Lingui from day one if more than one language is plausible. - Crash and error reporting (Sentry) with source maps uploaded per build.
- Offline-first: decide the sync and conflict rule (last write wins, server wins, or merge) per data type before building the queue, and show the user pending and failed states.
- Biometric sign-in unlocks a stored credential through
expo-local-authenticationandSecureStore; keep a non-biometric fallback and handle enrolment changes. - Background work and location cost battery: request the lowest accuracy and shortest background window the feature needs, and test on a real device with the battery profiler.
Performance on device
- Profile release builds on a mid-range Android device, not the iOS simulator.
- Startup: lazy-require heavy screens, avoid top-level work in modules, measure with
expo-atlasfor bundle composition. - Frames: React Native DevTools / Perf Monitor; move heavy work to worklets or native; avoid bridging in loops.
- Memory: unsubscribe listeners on unmount, cap image cache, page data.
Testing
jest-expo+ Testing Library for React Native for components and hooks.- Maestro (or Detox) flows on real devices or emulators for critical paths; run on EAS-built binaries in CI.
- Manual matrix: smallest supported iPhone, a mid-range Android, both OS minimum versions, dark mode, large font sizes.
- Walk section 3 of
../../references/checklists/engineering-quality-bar.mdfor each scenario the change reaches: cold start, warm start, resume from background, offline, old installed build against new code. Name untested ones in the report. - Run the flows against staging with a masked copy of production data that keeps real lengths and shapes (long names, zero items, a 500-item list), not one fixture account.
Verification
npx expo-doctor && npx expo install --check
tsc --noEmit && eslint .
jest
eas build --profile preview --platform all # then install on devices
Guardrails
- Do not eject to bare workflow to solve something a config plugin or development build already solves.
- Do not ship native changes through EAS Update.
- Do not store tokens in AsyncStorage or ship secrets in
EXPO_PUBLIC_*. - Do not test only on simulators before a release candidate.
- Do not move an app from SDK 54 or older to SDK 55+ until every native dependency supports the New Architecture: there is no legacy fallback after SDK 54.
Output format
Expo SDK: [xx] - RN: [x.y] - Workflow: [managed | dev build | bare] - Legacy-arch deps: [none / list]
Router: [Expo Router | React Navigation] - Data: [...] - Storage: [...]
Findings:
P0/P1/P2 - [file:line or config key] - [issue] - [fix]
Change plan: [smallest correct change]
Device verification: [devices/OS versions tested, results]
References
../../references/checklists/expo-react-native-checklist.md../../references/checklists/react-development-checklist.md../../references/checklists/mobile-app-release-checklist.md../../references/checklists/engineering-quality-bar.md
Offline, biometric and battery bullets adapted in part from engineering/engineering-mobile-app-builder.md (agency-agents, MIT).
Screen-level patterns
- Thin route files: a route reads and validates params, then hands off to a screen component in
features/orcomponents/. Deep links and dynamic routes deliver untrusted strings, so parse them with a schema (for examplez.string().uuid()) androuter.replace('/not-found')on failure. - State has one home each: server data in a query cache (never copied into a client store); UI state in a small store or context (start with local
useState); route state in router params; forms in a form library plus schema resolver; tokens in SecureStore; non-secret persistence in MMKV or AsyncStorage. - Validate at the boundary: parse API responses, route params, and push payloads with a schema, and infer types from it.
- Every screen renders loading, error, and empty states (not just a spinner); errors use an alert accessibility role. Pull-to-refresh via
onRefreshplusrefreshing. - Lists: memoized row components and a memoized
renderItem, stablekeyExtractor; tuneinitialNumToRenderandwindowSizeonFlatList;FlashListfor large or mixed lists. - Native APIs live in
use*hooks, never in JSX. Track a status (loading, denied, granted) rather than just a value, so the UI can tell "still loading" from "permission denied". Use anactiveflag in effect cleanup to ignore stale results after unmount. - Styling: pick one system (StyleSheet or a utility-class library) and stay with it; no inline style objects on hot paths.
- Forms: set
keyboardType,autoCapitalize, and anaccessibilityLabelon inputs; respect safe areas and Dynamic Type from the start. A decimal keyboard types the phone's own separator, andparseFloat("0,01")returns 0, so parse money with the user's locale. - Never ship a real secret in the bundle; privileged calls stay server-side and only public keys protected by backend rules go in the app.
Adapted in part from ECC skills/react-native-patterns (affaan-m/ECC, MIT).