When a team starts a Ruby on Rails application, the front-end question comes up fast: "Should we use React?" Often because it is what everyone knows, sometimes because an investor or an upcoming hire demands it, and rarely after anyone has priced what it costs. This article is for CTOs, founders and product leads who have to make the call. It walks through the four architectures actually used in 2026, what each one means for development and maintenance, and the situations where React is worth its price.

React vs Ruby on Rails: the wrong question

The "React JS vs Ruby on Rails" comparison comes up all the time. It makes little sense, because the two tools do not operate at the same level:

  • React is a JavaScript library maintained by Meta. It runs in the browser (or on a Node.js server for the initial render) and is only used to build the interface: components, local state, reactions to clicks.
  • Ruby on Rails is a complete server-side framework: routing, database, business logic, authentication, emails, background jobs and HTML page rendering. For the details, see our article Ruby on Rails: definition and how it works.

React does not replace Rails, then. Even an application whose entire screen is built in React needs a back end to store data and enforce business rules, and that back end can be Rails. The meaningful comparison is Hotwire vs React, Hotwire being the front-end layer that Rails provides itself. If you are still weighing the back-end framework, that is a different debate, covered in Ruby on Rails vs Django and Ruby on Rails vs Symfony.

Option 1: Hotwire (Turbo + Stimulus), the Rails 8 default

An application created with rails new ships with Hotwire out of the box, with no configuration. The idea: the server keeps producing HTML, and the browser updates it intelligently instead of reloading the whole page.

  • Turbo Drive intercepts links and forms to swap the page content without a full reload.
  • Turbo Frames splits a page into areas that update independently (a table row edited in place, a tab, a modal).
  • Turbo Streams pushes HTML fragments from the server, in response to a form or in real time over WebSocket (a notification, a counter, a comment thread).
  • Stimulus adds small JavaScript controllers for what has to stay in the browser: a dropdown menu, a field that formats itself, simple drag and drop.

By default, Rails 8 loads this JavaScript with importmap, with no Node.js and no build step.

What it costs: a single codebase, a single language for business logic, Rails system tests that cover the whole user journey, and server-rendered HTML that Google reads without any trouble. A single Rails developer can ship a complete screen, from the model to the interface. The trade-off: every slightly rich interaction requires thinking in terms of "HTML fragments sent back by the server", and screens whose state changes on every keystroke or mouse movement become laborious.

Option 2: React embedded in the Rails application

Here, Rails stays in charge of pages, routes and sessions, and React is mounted in specific areas of the screen. There are three ways to set it up:

  • jsbundling-rails: Rails delegates compilation to esbuild, Bun, Rollup or Webpack. This is the official option for JavaScript that needs a build step, which is the case for React with JSX.
  • vite_ruby (the vite_rails gem): Vite compiles the assets, with very comfortable hot reloading in development. Many front-end teams prefer it.
  • importmap: possible in theory, but a poor fit. JSX has to be compiled, so you either write React without JSX or precompile elsewhere, which defeats the point of going build-free.

Components receive their data through HTML attributes or JSON calls to Rails controllers. Gems such as react_on_rails industrialise this setup, including server-side rendering.

What it costs: one application and one deployment, but two worlds that have to coexist. You need a JavaScript build pipeline, component tests (Jest or Vitest) on top of the Rails tests, and npm dependencies that age quickly. React areas are not server-rendered without extra effort, which matters if they carry content you want indexed.

Option 3: Inertia.js with inertia-rails

Inertia.js is a bridge between a classic back end and a React, Vue or Svelte front end. With the inertia-rails gem, a Rails controller no longer renders an ERB view but a React component, passing it its data:

class ProjectsController < ApplicationController
  def index
    render inertia: "Projects/Index", props: {
      projects: current_user.projects.as_json(only: %i[id name status])
    }
  end
end

The browser gets a SPA-like experience (navigation without reloads, state preserved in components), but there is no API to design: routes, authentication, authorization, validations and redirects all stay in Rails. Form errors come back just as they do in a classic Rails application.

What it costs: the whole screen is React, so the team has to be comfortable on both sides, and a build pipeline (usually Vite) is mandatory. Server-side rendering for SEO exists, but it requires a Node.js process running alongside Rails. For a back office or a SaaS behind a login, that is generally not a problem. Inertia also does not give you an API that a mobile app can reuse.

Option 4: Rails in API mode with a separate SPA (Next.js, for example)

Rails is created with rails new --api: it no longer produces HTML, only JSON. The front end is a full application in its own right, often built with Next.js, with its own repository, hosting and deployment cycle.

This is the most decoupled architecture, and the most expensive one. In practice, you maintain:

  • two codebases, two CI pipelines and two deployments to keep in sync every time the API changes;
  • an API contract to document and version (serialization, pagination, error codes), often with an OpenAPI or GraphQL schema;
  • token-based authentication (JWT or cookies shared across domains), which is trickier to secure than native Rails sessions;
  • duplicated logic: validations on both the client and the server, permission checks to show or hide buttons;
  • end-to-end tests that have to boot both applications.

On the team side, a feature usually goes through one back-end developer and one front-end developer, with all the coordination that implies. On the SEO side, Next.js can render pages on the server, but that is one more Node.js infrastructure to run.

This option makes sense when the API has other clients besides the website (mobile app, partners, integrations), or when two separate teams need to move at different paces.

Comparison table of the four options

Criterion Hotwire Embedded React Inertia.js API + SPA
Codebases1112
JS build pipelineNone (importmap)YesYesYes, separate
API to designNoPartial (JSON endpoints)NoYes, complete
AuthenticationRails sessionRails sessionRails sessionTokens, CORS
Team profileRails developersRails + some ReactRails + ReactSeparate back end and front end
TestsRails tests (system)Rails + componentsRails + componentsTwo suites + end-to-end
SEONative (server HTML)Native outside React areasServer rendering via Node.jsServer rendering via Next.js
Very rich interfacesLimitedGoodGoodExcellent
API for mobileTo be addedTo be addedTo be addedIncluded
Maintenance costLowestModerateModerateHighest

When React is really worth it

Hotwire covers most of the screens in a business application or a B2B SaaS: forms, filterable lists, dashboards, notifications, modals, inline editing. React pulls ahead in specific cases:

  • Interfaces where state lives in the browser. A drag-and-drop document or form builder, a spreadsheet with formulas and multi-selection, a canvas (floor plan, diagram, whiteboard), a schedule you manipulate with the mouse. A server round trip on every interaction makes no sense there. On top of that, the React ecosystem offers mature libraries for these use cases.
  • A React Native mobile app. If the product has to exist on iOS and Android with a native interface, a Rails API shared between web and mobile becomes the natural choice, and sharing skills (or even code) between React and React Native has real value. Worth noting: Hotwire Native also lets you publish a mobile app that reuses your Rails web screens, an option to explore before committing to two front ends.
  • A front-end team that already works in React. If you have experienced React front-end developers and few Rails profiles, forcing Hotwire on them slows things down more than it helps. Inertia.js is then often the best compromise.
  • Advanced offline mode. An application that must work without a network and sync later needs rich client-side state, which points towards React.

Conversely, "React because it is more modern" or "because recruiters ask for it" are not good enough reasons. This choice commits you to years of maintenance, as we explain in our page on Rails MVP and SaaS development: early on, every week counts, and a second codebase eats into them.

The hybrid approach: React islands in a Hotwire application

The choice is not binary. An application can be 90% Hotwire and contain one or two React screens where the interaction demands it: the quote editor, the schedule, the configurator. This is known as the "islands" approach.

Technically, a Stimulus controller mounts the React component when the element appears on the page and unmounts it when Turbo removes it. Initial data is passed through a data- attribute, and saves go through a JSON endpoint or a classic Rails form. Gems such as turbo-mount automate this wiring. The build pipeline (jsbundling-rails or Vite) then only concerns those few components.

The benefit is twofold: you pay the cost of React only where it pays off, and the rest of the application keeps the simplicity of Rails. The catch is discipline: without a clear rule about what deserves an island, React spreads screen by screen and you end up with two ways of doing the same thing.

Decision matrix

Your situation Recommended option
MVP, B2B SaaS or business application, Rails team or small teamHotwire
Hotwire application with one or two highly interactive screensHotwire + React islands
Team comfortable with React, application behind a login, no native mobile appInertia.js
Web app and React Native mobile app sharing the same dataRails API + React front end (Next.js or SPA)
Mobile app wanted, but screens close to the web versionHotwire + Hotwire Native
API open to partners, separate back-end and front-end teamsRails API + separate SPA
Website with high SEO stakes plus a customer areaHotwire for public pages, React islands in the customer area if needed
Existing Rails application with an ageing React front endAudit before choosing: gradual migration to Inertia or Hotwire, or keep it as is

A simple tie-breaker: start with the option that needs the fewest codebases, and add React when a specific screen calls for it. Moving from Hotwire to React screen by screen is easy, because the models and business logic stay put. Going the other way, leaving a SPA to return to Rails, often means rewriting the front end.

Our position at Akolads: Hotwire by default, React when justified

On the projects we run, we start with Hotwire. It lets a small team ship fast, and lets another Rails developer pick up the code years later. When a screen needs interactivity that Hotwire makes laborious, we add a targeted React island, or we suggest Inertia.js if the client's team is already React-oriented. We only recommend a separate API + SPA architecture when a mobile app, partners or an organisation in separate teams make it necessary.

This choice is made during scoping, with a list of screens and their level of interaction, not out of principle. That is how we work on custom business applications as well as in our Ruby on Rails agency.

React is not a bad choice, it is an expensive one. It has to pay for itself with a real gain for the user, screen by screen.

FAQ

Are React and Ruby on Rails competitors?

No. React is a JavaScript library that builds interfaces in the browser. Ruby on Rails is a full-stack framework that handles the server, the database, the business logic and page rendering. The real comparison is React versus Hotwire, the front-end layer that ships with Rails, not React versus Rails.

Can you use React with Ruby on Rails?

Yes, in three ways: embed React in the Rails application with jsbundling-rails or vite_ruby, use Inertia.js with the inertia-rails gem so that Rails controllers render React pages, or turn Rails into an API consumed by a separate React application, such as Next.js.

Is Hotwire enough for a SaaS application?

For the vast majority of B2B SaaS products, yes: forms, filterable tables, dashboards, real-time notifications and modals are well served by Turbo and Stimulus. Hotwire reaches its limits on screens where state changes continuously in the browser, such as a visual editor, a spreadsheet or a canvas.

Is Inertia.js a good alternative to a Rails API?

Yes, if you want React screens without maintaining a public API. Routing, authentication and authorization stay in Rails, and controllers pass data straight to React components. However, if a mobile app or partners need to consume your data, you will still need an API.

Can you move from Hotwire to React later?

Yes, and it is often the best strategy. Models, business logic and the database do not change. You can add React screen by screen, as islands inside Hotwire pages or through Inertia.js, without rewriting the application. Starting with React and then moving back to Hotwire is, in practice, more expensive.