$npx -y skills add callstackincubator/agent-skills --skill upgrading-react-nativeUpgrades React Native apps to newer versions by applying rn-diff-purge template diffs, updating package.json dependencies, migrating native iOS and Android configuration, resolving CocoaPods and Gradle changes, and handling breaking API updates. Use when upgrading React Native, b
| 1 | # Upgrading React Native |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Covers the full React Native upgrade workflow: template diffs via Upgrade Helper, dependency updates, Expo SDK steps, and common pitfalls. |
| 6 | |
| 7 | ## Typical Upgrade Sequence |
| 8 | |
| 9 | 1. **Route**: Choose the right upgrade path via [upgrading-react-native.md][upgrading-react-native] |
| 10 | 2. **Diff**: Fetch the canonical template diff using Upgrade Helper via [upgrade-helper-core.md][upgrade-helper-core] |
| 11 | 3. **Dependencies**: Assess and update third-party packages via [upgrading-dependencies.md][upgrading-dependencies] |
| 12 | 4. **React**: Align React version if upgraded via [react.md][react] |
| 13 | 5. **Expo** (if applicable): Apply Expo SDK layer via [expo-sdk-upgrade.md][expo-sdk-upgrade] |
| 14 | 6. **Verify**: Run post-upgrade checks via [upgrade-verification.md][upgrade-verification] |
| 15 | |
| 16 | ```bash |
| 17 | # Quick start: detect current version and fetch diff |
| 18 | npm pkg get dependencies.react-native --prefix "$APP_DIR" |
| 19 | npm view react-native dist-tags.latest |
| 20 | |
| 21 | # Example: upgrading from 0.76.9 to 0.78.2 |
| 22 | # 1. Fetch the template diff |
| 23 | curl -L -f -o /tmp/rn-diff.diff \ |
| 24 | "https://raw.githubusercontent.com/react-native-community/rn-diff-purge/diffs/diffs/0.76.9..0.78.2.diff" \ |
| 25 | && echo "Diff downloaded OK" || echo "ERROR: diff not found, check versions" |
| 26 | # 2. Review changed files |
| 27 | grep -n "^diff --git" /tmp/rn-diff.diff |
| 28 | # 3. Update package.json, apply native changes, then install + rebuild |
| 29 | npm install --prefix "$APP_DIR" |
| 30 | cd "$APP_DIR/ios" && pod install |
| 31 | # 4. Validate: both platforms must build successfully |
| 32 | npx react-native build-android --mode debug --no-packager |
| 33 | xcodebuild -workspace "$APP_DIR/ios/App.xcworkspace" -scheme App -sdk iphonesimulator build |
| 34 | ``` |
| 35 | |
| 36 | ## When to Apply |
| 37 | |
| 38 | Reference these guidelines when: |
| 39 | - Moving a React Native app to a newer version |
| 40 | - Reconciling native config changes from Upgrade Helper |
| 41 | - Validating release notes for breaking changes |
| 42 | |
| 43 | ## Quick Reference |
| 44 | |
| 45 | | File | Description | |
| 46 | |------|-------------| |
| 47 | | [upgrading-react-native.md][upgrading-react-native] | Router: choose the right upgrade path | |
| 48 | | [upgrade-helper-core.md][upgrade-helper-core] | Core Upgrade Helper workflow and reliability gates | |
| 49 | | [upgrading-dependencies.md][upgrading-dependencies] | Dependency compatibility checks and migration planning | |
| 50 | | [react.md][react] | React and React 19 upgrade alignment rules | |
| 51 | | [expo-sdk-upgrade.md][expo-sdk-upgrade] | Expo SDK-specific upgrade layer (conditional) | |
| 52 | | [upgrade-verification.md][upgrade-verification] | Post-upgrade verification checklist, including agent-device-assisted checks | |
| 53 | | [monorepo-singlerepo-targeting.md][monorepo-singlerepo-targeting] | Monorepo and single-repo app targeting and command scoping | |
| 54 | |
| 55 | ## Problem → Skill Mapping |
| 56 | |
| 57 | | Problem | Start With | |
| 58 | |---------|------------| |
| 59 | | Need to upgrade React Native | [upgrade-helper-core.md][upgrade-helper-core] | |
| 60 | | Need dependency risk triage and migration options | [upgrading-dependencies.md][upgrading-dependencies] | |
| 61 | | Need React/React 19 package alignment | [react.md][react] | |
| 62 | | Need workflow routing first | [upgrading-react-native.md][upgrading-react-native] | |
| 63 | | Need Expo SDK-specific steps | [expo-sdk-upgrade.md][expo-sdk-upgrade] | |
| 64 | | Need manual or agent-assisted regression validation | [upgrade-verification.md][upgrade-verification] | |
| 65 | | Need repo/app command scoping | [monorepo-singlerepo-targeting.md][monorepo-singlerepo-targeting] | |
| 66 | |
| 67 | [upgrading-react-native]: references/upgrading-react-native.md |
| 68 | [upgrade-helper-core]: references/upgrade-helper-core.md |
| 69 | [upgrading-dependencies]: references/upgrading-dependencies.md |
| 70 | [react]: references/react.md |
| 71 | [expo-sdk-upgrade]: references/expo-sdk-upgrade.md |
| 72 | [upgrade-verification]: references/upgrade-verification.md |
| 73 | [monorepo-singlerepo-targeting]: references/monorepo-singlerepo-targeting.md |