React Router 7 in Hydrogen: Upgrade Guide for Agencies

Introduction

In May 2025, Shopify mandated that all Hydrogen projects migrate to React Router 7 (RR7). For agencies managing dozens of storefronts, this isn’t just a version bump — it’s a project-wide upgrade with risks and opportunities.

This guide breaks down what changed, how to migrate safely, and how agencies can turn the RR7 upgrade into a billable service.

What Changed in RR7

  • 🔀 New data APIs
    • defer + await patterns updated.
    • Simplified loader + action APIs.
  • 🛣️ Route definitions
    • Updated import paths.
    • Better nested routing but breaking changes in v6 code.
  • ⚡ Future flags
    • Optional pre-upgrade flags now required.
    • Codemods handle most syntax shifts.

👉 TL;DR: RR7 improves clarity + performance, but old loaders + nested routes will break without changes.

Migration Strategy

1. Run Codemods

React Router team ships codemods to auto-update imports + patterns.

npx @react-router/codemod v7 ./src

2. Enable Future Flags

Hydrogen already supports RR7 “future flags” — turn them on early to catch deprecations before May 2025.

3. Audit Loaders + Actions

  • Replace deprecated APIs.
  • Update data fetching patterns with new RR7 syntax.

4. Test Nested Routes

  • Watch for bugs in dynamic routes (PDPs, PLPs, custom pages).
  • Ensure redirects + fallbacks still work.

Risks

  • ❌ Third-party packages built for RR6 may break.
  • ❌ Nested route conflicts → critical in multi-level menus.
  • ❌ Agency downtime → missed migrations = client outages.

Case Example: Multi-Store Migration

  • Agency with 12 Hydrogen storefronts.
  • Ran codemods + future flags in staging.
  • Built a migration checklist for devs.
  • Completed migration in 2 weeks.
  • Outcome: no outages, agency billed clients for “upgrade assurance.”

Agency Deliverable

Agencies can productize RR7 migrations as:

  • Migration checklist (CI/CD integrated).
  • Upgrade insurance → recurring retainer for framework shifts.
  • Client education → docs + workshops.

👉 Position the upgrade as risk protection + new feature enablement.

Guardrails

  • ✅ Run codemods early in staging.
  • ✅ Enable future flags before May 2025 deadline.
  • ✅ Audit nested routes carefully.
  • ✅ Create CI/CD tests around critical PDP/PLP paths.

Conclusion

React Router 7 isn’t optional for Hydrogen — it’s the new baseline. Agencies that handle migrations proactively not only prevent outages, they can bill for peace of mind.

Don’t wait for Shopify to force the upgrade — get ahead, stay safe, and get paid.