Use this guide to choose an application shape before retrieving a task-sized implementation recipe. Each pattern and linked example is generic: rename the domain types, connect the interfaces to your backend, and verify package versions against the application you are building.
Choose the Smallest Architecture That Fits
Server-Mediated Generation
Keep provider secrets and authorization checks in an Expo Router API route or another trusted service. The client submits a validated command and renders durable job state. Give every submission an idempotency key so a retry cannot create duplicate work or consume usage twice.
Authentication and Protected Navigation
Put provider-specific login code behind an adapter. Store only the native credential needed to restore the session, refresh it through one single-flight path, and derive protected navigation from session state. Test redirect schemes in installed development and production builds.
Entitlements and Usage Limits
Model purchases, active entitlements, restoration, and metered usage separately. The device may present purchase UI, but a trusted service should authorize valuable work and apply usage changes atomically.
Realtime Media
Treat permission, audio-session configuration, peer connection state, interruptions, route changes, and teardown as one lifecycle. Mint short-lived connection credentials on a server and make cleanup safe to call more than once.
Durable Background Work
Persist a job before starting network work. Record its remote identifier, progress, retry state, and terminal result so the app can reconcile after navigation, connectivity loss, or process termination.
Social and Messaging Surfaces
Keep feeds, message lists, reaction controls, composers, and people discovery transport-neutral. Normalize server records at the boundary, use stable IDs for lists, and reconcile optimistic cache updates with authoritative responses.
Native Platform Boundaries
Hide files, incoming shares, native UI state, and optional native capabilities behind typed adapters. Platform-specific files should expose the same contract so product code does not branch throughout the component tree.
Recipe Map
Each topic contains copyable TypeScript or TSX examples plus the invariants needed to adapt them safely.
| Task | Recipe topic | Included examples |
|---|---|---|
| Restore sessions and protect routes | auth-session-recipes | session provider, protected layout, credential adapter, single-flight refresh |
| Validate and authorize server routes | expo-api-route-recipes | authenticated route helper, Zod parsing, provider adapter, idempotent command |
| Gate features and meter usage | purchases-and-usage-recipes | entitlement provider, restore flow, atomic usage consumption |
| Receive shares and own playback | media-sharing-audio-recipes | share-intent routing, durable file import, playback ownership hook |
| Run a realtime voice session | realtime-audio-recipes | short-lived session route, peer setup, teardown, reconnect policy |
| Survive generation retries and restarts | durable-generation-recipes | persisted job schema, queue upsert, submission, restart reconciliation |
| Isolate platform capabilities | native-platform-recipes | platform file split, native state, lazy capability factory |
| Fetch, validate, and render server data | react-native-data-client-recipes | validated fetch, query options, cancellation, virtualized list, reducer |
| Add responsive motion | react-native-animation-recipes | press feedback, swipe action, scroll header, reduced motion |
| Build a message timeline | chat-component-recipes | message row, retryable composer, anchored timeline, mentions |
| Add reactions | reaction-system-recipes | normalization, animated bar, people sheet, optimistic cache mutation |
| Compose rich text | rich-text-composer-recipes | document validation, typed editor bridge, mention list, pasted media |
| Accept content from other apps | share-extension-recipes | app config, native-intent route, durable draft, destination picker |
| Build a social feed | social-feed-component-recipes | post card, media grid, action bar, composer, people list, optimistic likes |
Retrieve a topic directly when you know the boundary, or search in the language of the feature:
get-react-native-guide({
query: "build an anchored chat timeline with optimistic reactions and a rich text composer"
})
Adoption Checklist
- Confirm the installed Expo SDK, React Native version, and package compatibility.
- Replace sample identifiers, redirect schemes, environment variables, and domain types.
- Keep credentials and privileged authorization on a trusted service.
- Validate every network and extension payload at its boundary.
- Make commands idempotent and persist long-running state before starting work.
- Test purchases, deep links, notification actions, and extensions in installed builds.
- Add product-specific accessibility, observability, privacy declarations, and release profiles.