React Native Cookbook
Version: 1.1.0 | Updated: 2026-07-16
Purpose
Operate AI-assisted changes to a screen, navigation flow, FlatList, native module, platform adapter, or mobile release using React Native's native contracts, commands, failure evidence, architecture, and rollback mechanisms.
Why
Domain logic is shared; platform behavior is explicit; native boundaries are typed; JS/UI threads and lists are measured on representative devices. Generic software advice cannot verify that invariant because the decisive evidence lives in package.json/lockfile, Podfile/lock, Gradle catalogs/wrapper, Xcode project, and platform deployment targets; Metro config/resolution, generated native code/autolinking state, and debug/release build settings; JS/UI frame rates, Hermes profile, native Instruments/Perfetto trace, memory, startup, and list metrics.
How
- Supply the evidence below to the matching XML prompt.
- Execute the skill's native workflow rather than accepting prose-only output.
- Use the error workflow to classify observed failure before changing state.
- Preserve architecture boundaries in
architecture/patterns.md. - Block review or release on any unchecked technology gate.
Required evidence
package.json/lockfile, Podfile/lock, Gradle catalogs/wrapper, Xcode project, and platform deployment targets- Metro config/resolution, generated native code/autolinking state, and debug/release build settings
- JS/UI frame rates, Hermes profile, native Instruments/Perfetto trace, memory, startup, and list metrics
- screen-reader tree, focus order, dynamic text, touch target, keyboard, and platform permission behavior
Native verification
npx react-native infoandnpx react-native doctornpx react-native bundle --platform android --dev false --entry-file index.js --bundle-output <path>for bundle verificationcd android && ./gradlew lint test assembleReleasecd ios && xcodebuild -workspace <app>.xcworkspace -scheme <scheme> -configuration Release teston approved macOS CInpx react-native log-androidor platform-native logs for the reproduced build
Version-aware caution
Read React Native, React, navigation, native dependency, Gradle/AGP/Kotlin, Xcode/Swift, deployment-target, and architecture settings. Native APIs, autolinking, Metro, Hermes, and New Architecture compatibility are release-specific.
Tradeoffs
This cookbook requires deeper React Native evidence and specialist review than a generic template. The additional work buys reproducible diagnostics and a rollback that respects screen, navigation flow, FlatList, native module, platform adapter, or mobile release state.
Anti-patterns
- Scattering
Platform.OSbranches through domain logic creates two untestable applications hidden in one source tree. - Do not remove a native warning, validator, policy, or safety limit merely to make generated output pass.
- Do not claim a successful result without preserving the command, target, artifact/revision, and observed output.
Enterprise considerations
React Native governance aligns JS/native dependency matrices, signing, store roles, OTA policy, privacy declarations, device support, accessibility evidence, and crash-symbol retention.
Official sources
Checklist
- Installed/deployed version and target environment are recorded.
- Native commands are selected from repository and platform evidence.
- Failure classes and rollback boundary are explicit.
- Official sources are checked for the recorded version.
- No prompt variable remains unresolved.
Changelog
- 1.1.0 (2026-07-16): Replaced cloned guidance with technology-native evidence, commands, architecture, and rollback.
- 1.0.0 (2026-07-16): Added initial cookbook.