Hydrogen, React Router, or Next.js: Choosing a Shopify Headless Stack
A practical framework for choosing between Shopify Hydrogen, React Router, and Next.js when planning a headless Shopify storefront.
Hydrogen, React Router, or Next.js: Choosing a Shopify Headless Stack
10 min read
Hydrogen, React Router, or Next.js: Choosing a Shopify Headless Stack
The wrong way to choose a Shopify headless stack is to start with framework loyalty.
Next.js is mature, familiar, and flexible. Hydrogen is Shopify's official headless path. React Router is the foundation Hydrogen now builds on, with a simpler route, loader, and action model than many teams expect if they last looked during the Remix era.
All three can power a fast storefront. The real question is not "which framework is best?" The better question is:
Which stack will your team still understand, afford, and operate twelve months after launch?
This guide gives you a practical decision framework for Shopify brands evaluating Hydrogen, React Router, and Next.js in 2026.
The short version
Choose Hydrogen on Oxygen when Shopify is the center of the business and the storefront should stay close to Shopify's roadmap.
Choose React Router outside Oxygen when you like Hydrogen's mental model but need a custom runtime, a different host, or deeper control over deployment.
Choose Next.js when the storefront is one part of a larger product platform, especially if your team already runs dashboards, APIs, content apps, or customer portals in the same Next.js and Vercel workflow.
Do not choose Next.js only because it is popular. Do not choose Hydrogen only because Shopify made it. Choose the system that matches your operational reality.
What each option is really optimizing for
Hydrogen
Hydrogen is Shopify's headless framework for custom storefronts. It is built around React Router and includes Shopify-specific primitives for storefront data, cart behavior, variants, analytics, localization, and deployment to Oxygen.
Hydrogen is strongest when your storefront mostly needs to compose Shopify commerce data with content, merchandising, personalization, and a clean React interface.
Its advantage is not magic performance. A well-built Next.js storefront can also be fast. Hydrogen's advantage is reduced translation work. Cart, product, customer, and market concepts line up with Shopify's APIs instead of being rebuilt from scratch.
React Router
React Router is the framework layer underneath modern Hydrogen. It gives you nested routes, route-level data loading, actions for writes, streaming, error boundaries, and a clear full-stack React model.
For Shopify teams, the important part is the data flow. Product pages, collection pages, cart mutations, and account routes map naturally to loaders and actions. The patterns are boring in a good way.
React Router also keeps hosting choices open. Hydrogen prefers Oxygen, but React Router itself can run in other environments if your platform team has a reason to own that layer.
Next.js
Next.js is the broadest option. It is a general-purpose React framework with a massive ecosystem, strong hiring market, and deep Vercel integration.
That flexibility matters when the storefront is not isolated. If your ecommerce experience depends on custom APIs, account dashboards, pricing engines, content workflows, or internal tools that already live in a Next.js platform, one shared framework can reduce team friction.
The tradeoff is complexity. App Router, Server Components, caching directives, middleware, image optimization, and platform-specific behavior can all be useful. They can also be a lot for a commerce team that mainly needs product pages, collections, search, cart, and checkout handoff.
The decision criteria that actually matter
Use these questions before picking a stack.
1. What is the source of truth?
If Shopify owns products, inventory, checkout, customer accounts, markets, B2B rules, and most merchandising logic, Hydrogen should be the default candidate.
If Shopify is only one data source among several, Next.js or standalone React Router may fit better. That is common when a brand has custom pricing, complex fulfillment promises, membership logic, or a separate product information platform that does not map cleanly to Shopify.
2. Who owns hosting and incidents?
Hydrogen with Oxygen keeps the storefront close to Shopify and removes one major hosting decision. That is valuable for lean teams.
Next.js on Vercel, Cloudflare, or another platform gives more infrastructure control, but control has a cost. Someone owns cache behavior, deployment configuration, observability, billing, edge runtime differences, and incident response.
If no one on the team wants that ownership, do not pretend it is free.
3. How much non-commerce application code do you need?
A pure storefront is mostly catalog, content, search, cart, and checkout. Hydrogen is built for that.
A commerce product platform might include:
- B2B quote workflows
- authenticated buyer portals
- custom dashboards
- subscriptions or memberships outside Shopify
- warehouse or ERP integrations
- editorial tools
- personalization services
- analytics APIs
When those features are central to the business, Next.js can be reasonable because the storefront and adjacent apps can share patterns, deployment, auth, logging, and team knowledge.
4. What does the content team need?
Hydrogen works well with external CMS tools like Sanity, Contentful, and Shopify metaobjects. Next.js does too.
The difference is usually not CMS support. The difference is who will maintain previews, draft mode, webhook invalidation, cache rules, visual editing, and author permissions.
If the marketing team needs a heavy editorial system with many page types, confirm that your chosen stack has a clean preview story before you commit.
5. What is the cost profile after launch?
Framework choice affects cost in three places:
- build cost, because the team needs to ship the first version
- operating cost, because someone maintains hosting, monitoring, and deploys
- change cost, because future campaigns and experiments need engineering time
Hydrogen often lowers operating cost for Shopify-first brands because less infrastructure sits outside Shopify. Next.js can lower change cost for teams already standardized on it. The cheaper option depends on your team, not the logo on the framework website.
A simple scoring rubric
Score each row from 1 to 5. The highest total is not automatically the answer, but it will expose the tradeoffs.
| Criteria | Hydrogen + Oxygen | React Router custom host | Next.js |
|---|---|---|---|
| Shopify-native workflows | 5 | 4 | 3 |
| General app flexibility | 3 | 4 | 5 |
| Hosting simplicity | 5 | 3 | 3 |
| Custom infrastructure control | 2 | 5 | 5 |
| Developer hiring pool | 3 | 4 | 5 |
| Long-term storefront focus | 5 | 4 | 3 |
| Cross-app platform consistency | 2 | 4 | 5 |
For most Shopify-first DTC brands, Hydrogen will score highest. For platform-heavy teams, Next.js often wins. For technical teams that want the React Router model without committing every deployment decision to Oxygen, custom React Router can sit in the middle.
Common scenarios
Scenario 1: Shopify-first DTC brand
You sell through Shopify, checkout is standard, your team needs product pages, collection pages, search, cart, content, and fast campaign launches.
Recommendation: Hydrogen + Oxygen.
You get Shopify-native primitives, a hosting path designed for the stack, and fewer decisions that distract from revenue work.
Scenario 2: Brand with serious editorial needs
You run a Shopify storefront, but campaigns depend on rich landing pages, buying guides, launches, and CMS-driven content.
Recommendation: Hydrogen + Oxygen or Next.js.
Hydrogen is a good fit if Shopify remains the commerce source of truth and your CMS integration is straightforward. Next.js becomes more attractive if the content system has complex preview, personalization, or shared app requirements already implemented in Next.js.
Scenario 3: B2B commerce with account workflows
You need company accounts, price lists, payment terms, gated catalogs, custom ordering, or account-specific content.
Recommendation: Start with Hydrogen, then pressure test integrations.
Hydrogen can work well with Shopify's B2B model. The deciding factor is usually not the storefront framework. It is whether account, pricing, ERP, and fulfillment data can be modeled cleanly without building a second commerce backend beside Shopify.
Scenario 4: Storefront plus internal product platform
Your storefront shares code with internal dashboards, APIs, admin tools, pricing services, and customer portals.
Recommendation: Next.js.
This is where Next.js earns its keep. A unified app platform can matter more than storefront-specific convenience, especially when the same team maintains every surface.
Scenario 5: You want headless but have a small team
You have one or two developers and a merchant team that wants more design flexibility, better performance, and fewer theme constraints.
Recommendation: Be careful. Hydrogen is the better headless option, but a premium Shopify theme may still be the better business move.
Headless is not a badge. It adds responsibility. If your team cannot maintain a custom React storefront, spend the budget on theme performance, app cleanup, better merchandising, and checkout improvements first.
Migration risks people underestimate
SEO parity
A headless rebuild changes URLs, structured data, internal links, pagination, collection filters, and content rendering. Preserve high-value URLs, crawl the staging site, and compare rendered HTML before launch.
Preview workflows
If merchandisers cannot preview product, collection, and content changes safely, they will route around the system. Build preview early, not in the final sprint.
Cart and analytics accuracy
Cart behavior touches discount codes, market rules, shipping thresholds, subscriptions, pixels, and consent. Treat it as a revenue system, not a UI component.
Cache invalidation
Fast stale pages are still wrong pages. Define what refreshes when products, prices, inventory, CMS entries, redirects, and navigation change.
Ownership after launch
The launch team often disappears after go-live. Document who owns framework upgrades, dependency patches, observability, CMS schema changes, and performance budgets.
My practical recommendation
For a Shopify-first brand in 2026, I would start with this order:
- Can a strong Online Store 2.0 theme solve the problem? If yes, stay on theme and invest in performance.
- Is Shopify the primary system and headless is justified? Choose Hydrogen + Oxygen.
- Do you need React Router patterns but custom hosting? Use React Router with a runtime your team already operates well.
- Is the storefront part of a broader app platform? Choose Next.js and budget for the operational complexity.
The best stack is not the one with the loudest ecosystem. It is the one that lets your team ship campaigns, protect checkout revenue, keep pages fast, and debug production without guessing.
Further reading
Two useful perspectives informed this post:
- Commerce-UI's Hydrogen vs. Next.js comparison, which frames the decision around total cost of ownership and platform alignment.
- Weaverse's React Router vs. Next.js comparison, which focuses on React Router's role in Hydrogen and the complexity tradeoffs of Next.js.
Use them as inputs, not as a template. Your stack decision should come from your data model, team shape, and launch risk.
Need help deciding?
If you are choosing between Hydrogen, React Router, and Next.js, the fastest path is a short technical discovery. We map your product data, content model, integrations, traffic profile, and team ownership into a build plan before a single component is written.
Book a Shopify strategy call and we will pressure test the stack before you commit the budget.
Stay Updated
Get Shopify build, conversion, and growth notes when we have something useful to share. We’ll ask you to confirm your email before sending anything else.
Useful Shopify notes, sent only when we have something worth sharing.
Erik Holmström
Founder & Lead Shopify Engineer
Shopify engineer focused on migrations, B2B setups, headless builds, and conversion work for scaling brands.
Related Posts
View AllHeadless Shopify: When and Why to Go Headless
5 min
Headless Shopify: When and Why to Go Headless
Learn the business triggers, technical considerations, and launch blueprint for a high-performing headless Shopify architecture.
Shopify Plus Checkout Customization: Best Practices for 2025
5 min
Shopify Plus Checkout Customization: Best Practices for 2025
Master checkout extensibility on Shopify Plus with proven patterns for upsells, branding, validation, and payment customization that protect conversion rates.
Shopify Liquid Templating: A Practical Tutorial for Developers
6 min
Shopify Liquid Templating: A Practical Tutorial for Developers
Learn Shopify Liquid from the ground up with practical examples covering objects, filters, tags, sections, and performance patterns for production themes.