Render React components from Rails view templates using a simple view helper without manually configuring a build pipeline.
Add server-side rendering to a Rails app so React components generate HTML on the server before JavaScript loads.
Write React components in JSX or TypeScript inside a Rails project using Shakapacker for asset bundling.
| reactjs/react-rails | brunch/brunch | thebird/swipe | |
|---|---|---|---|
| Stars | 6,758 | 6,758 | 6,755 |
| Language | JavaScript | JavaScript | JavaScript |
| Setup difficulty | moderate | easy | easy |
| Complexity | 3/5 | 2/5 | 1/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires a Rails app with either Shakapacker or Sprockets already configured for JavaScript bundling.
react-rails is a Ruby gem that connects the React JavaScript library with Ruby on Rails web applications. Without this gem, using React in a Rails app requires manual configuration to bundle and serve JavaScript components. This gem handles that integration, letting you render React components directly from Rails views and controllers. The main feature is server-side and client-side rendering. When a page loads, Rails can generate the initial HTML on the server using React components, which means the browser shows content immediately without waiting for JavaScript to run. The same components then become interactive in the browser. This gives you the speed of server-rendered HTML with the interactivity of a React application. To use a React component in a Rails view, you call a view helper that the gem provides, passing the component name and any data it needs. The gem supports writing components in JSX (the syntax most React developers use), as well as TypeScript and CoffeeScript. It works with both Shakapacker, the current webpack-based tool for Rails, and the older Sprockets asset pipeline, so it fits into both newer and older Rails setups. The README notes that ShakaCode, which currently maintains this gem, recommends considering a migration to a separate gem called react_on_rails for new projects. That project receives more active development, has TypeScript internals, and supports newer React features like React Server Components. Migration guides and an AI-assisted migration prompt are included in the repository. The gem includes a generator for creating new component files, configuration options for server-side rendering, and documentation on common errors. It is listed in the reactjs GitHub organization, indicating an association with the official React project, though day-to-day maintenance is handled by the ShakaCode team.
A Ruby gem that connects React components to Ruby on Rails apps, letting you render React from Rails views with server-side HTML generation for fast initial loads and browser-side interactivity.
Mainly JavaScript. The stack also includes Ruby, Rails, React.
Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.