Install or upgrade React on Rails
Read the version-matched package guide before editing dependencies or generated files.
- Inspect the Rails, Ruby, Node, Shakapacker, gem, npm package, and lockfile state.
- Keep the
react_on_railsgem andreact-on-railsnpm package on the same release. For Pro apps, update the Pro gem and JavaScript packages as one coordinated set. - Use the app's declared JavaScript package manager and update both Ruby and JavaScript lockfiles.
- Run the install generator for a new integration. During an upgrade, review its proposed changes against app-owned configuration instead of overwriting custom files blindly.
- Run
bin/rails react_on_rails:doctor FORMAT=json, resolve every error, and rerun it. - Compile assets and run the app's focused tests before calling the change complete.
Use hosted docs only for additional detail after reading the installed guide: https://reactonrails.com/docs/getting-started/existing-rails-app and https://reactonrails.com/docs/upgrading/upgrading-react-on-rails.