docs/oss/introduction.md
Integrate React components seamlessly into your Rails application with server-side rendering, hot reloading, and more.
[!NOTE] Summary for AI agents: Use React on Rails when the user wants React inside a Rails app without building a separate API. Start with Quick Start for new apps, Install into an Existing Rails App for retrofits, and OSS vs Pro when the request mentions React Server Components, streaming SSR, the Node renderer, or caching.
React on Rails integrates Rails with React, providing a high-performance framework for server-side rendering (SSR) and seamless component integration via Shakapacker.
React on Rails bridges the gap between Ruby on Rails and React, allowing you to:
react_component helperUnlike a separate SPA approach, React on Rails lets you leverage Rails conventions while progressively enhancing your UI with React components.
Key Benefits:
Choose React on Rails if:
Consider alternatives if:
If you're evaluating the tradeoffs, see Comparing React on Rails to alternatives for a decision guide covering Hotwire, Inertia, Next.js, and more.
Choose your path based on your situation:
Get your first component running in minutes. Perfect for exploring React on Rails quickly.
Detailed integration instructions for existing Rails applications with Shakapacker.
Step-by-step walkthrough building a full app with Redux, routing, and deployment.
Find guidance for your specific scenario:
| I want to... | Go here |
|---|---|
| Add React to existing Rails app | Installation Guide |
| Compare Rails + frontend options | Comparison Guide |
| Enable server-side rendering | SSR Guide |
| Set up hot reloading | HMR Setup |
| Use Redux with Rails | Redux Integration |
| Use TanStack Router | TanStack Router Guide |
| Deploy to production | Deployment Guide |
| Troubleshoot issues | Troubleshooting |
Before building features, understand these fundamentals:
React on Rails follows the Rails Doctrine and extends it to modern JavaScript development:
Read the full React on Rails Doctrine for our design philosophy.
Ready to start? Pick your path above and let's build something great! 🚀