README.md
React on Rails integrates React into Ruby on Rails applications with Rails view helpers, server-side rendering, hot reloading, and automatic bundle generation.
This README is intentionally brief. For setup guides, architecture, API reference, upgrades, examples, and Pro features, use the main documentation site: reactonrails.com/docs.
React on Rails is maintained by ShakaCode.
These docs are for React on Rails 17. Historical docs and code are available for v15 (code), v14, v13, v12, and v11. See the upgrade guide before using v15 material.
Create a new React on Rails app:
npx create-react-on-rails-app my-app
cd my-app
bin/rails db:prepare
bin/dev
New apps default to React on Rails Pro for React 19.2 support. Use --standard
only when you intentionally want an open-source-only setup.
Add React on Rails to an existing Rails app:
bundle add react_on_rails --strict
bundle exec rails generate react_on_rails:install
bin/dev
Render a component in any Rails view:
<%= react_component("HelloWorld", props: { name: "World" }) %>
If you hit setup issues, run:
bundle exec rake react_on_rails:doctor
react_component.React on Rails Pro adds higher-throughput SSR and advanced rendering features on top of the open-source gem, including Node renderer support, streaming SSR, React Server Components, fragment caching, and TanStack Router SSR.
ShakaCode Trust-Based Commercial Licensing: Try Pro freely in development, test, CI/CD, and staging. No token is required to evaluate. If no license is configured, Pro keeps running and logs license status instead of blocking your app. Production deployments require a paid license; see Pro pricing and sign up.
Start with the docs here:
Bug reports and pull requests are welcome. Start with CONTRIBUTING.md and the help wanted issues.
Suspected security vulnerabilities should be reported privately. See SECURITY.md for the disclosure process and supported version policy. Please do not open a public issue for security reports.
React on Rails is available as open source under the terms of the MIT License.
React on Rails Pro is offered under ShakaCode Trust-Based Commercial Licensing. No license token is required for evaluation, development, testing, or CI/CD; production deployments using Pro features require a paid license. See React on Rails Pro and Pro pricing and sign up for details.
Thanks to the companies supporting ShakaCode's open-source work.
<p> <a href="https://jb.gg/OpenSource"> </a> <a href="https://scoutapp.com"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/4244251/184881147-0d077438-3978-40da-ace9-4f650d2efe2e.png"> <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/4244251/184881152-9f2d8fba-88ac-4ba6-873b-22387f8711c5.png"></picture>
</picture>
</picture>
</picture>