tip-calculator-reactnative

Upgrading Libraries (Expo / React Native)

This project is an Expo app (currently expo ~53.x) with React Native (0.79.x) and React (19.x). Because Expo tightly couples native dependency versions, the safest way to upgrade is to upgrade Expo first, then update other libraries.

Quick rules

Before you start

  1. Ensure your local environment is healthy:
    • Node.js is installed
    • Yarn is installed (this repo includes yarn.lock)
  2. Create a branch.
  3. Record the current versions:
    • expo --version
    • node -v / yarn -v

Expo SDK upgrades are the “big” upgrades because they may change:

Steps

  1. Review Expo’s upgrade instructions for the target SDK:
    • Use the Expo CLI upgrade helper (preferred):
      • npx expo-doctor
      • npx expo install --check (checks compatible versions)
  2. Perform the upgrade:
    • Start with:
      • npx expo install expo@latest
    • Or, if upgrading to a specific SDK line (example):
      • npx expo install expo@~53.0.0
  3. Align Expo-managed dependencies:
    • Run:
      • npx expo install --fix
    • This updates dependencies to versions compatible with your Expo SDK.
  4. Reinstall dependencies cleanly:
    • Stop Metro / dev servers
    • Delete node_modules
    • Keep the repo’s package manager consistent:
      • yarn install

Notes for this repo

2) Upgrade JavaScript-only libraries (safe, frequent)

These are libraries that do not ship native code (or don’t require native rebuilds in managed workflow).

Suggested workflow

  1. See what’s outdated:
    • yarn outdated
  2. Upgrade conservatively:
    • Prefer minor/patch upgrades first.
    • For a single package:
      • yarn add <package>@<version>
  3. After upgrades:
    • yarn install
    • yarn start and exercise the app

3) Upgrade native or Expo-native libraries (requires care)

Many packages in this repo are native (or may be):

Use expo install for these

When a library is supported by Expo, use:

This chooses a version compatible with your Expo SDK.

Reanimated specific note

react-native-reanimated upgrades sometimes require:

If you see runtime errors after upgrading, first try:

4) React Navigation upgrades

This repo uses React Navigation v6 packages:

Guidelines:

5) When you need to rebuild native projects

This repo includes android/ and uses scripts like:

After upgrades that touch native code, do one of:

If local builds fail, the error is usually a version mismatch introduced by upgrading a native module outside Expo’s compatible range—re-run:

6) Verification checklist (do this every time)

7) Troubleshooting

“Version mismatch” / native module conflicts

Metro / bundling / stale cache

Android build failures after dependency changes