While the dawn of the large js, frontend app is long past and there is a new magical unicorn and pixi dust js framework everytime you turn around. There are still a lot of stock standard web apps out there. As a web consultancy these apps have been our bread and butter for quite some time and there is no real need to change them. They just work.
Notice: there is going to be a stupid amount of alliteration in this post. Fair warning. React rendering in rails rendered radical web app.
I am starting here because this is the easiest way to get started with React on Rails. Per usual, just include the gem in your gem file
bundle install, and then run the install generator
rails g react:install.
The reason I say this is it is fully integrated with sprockets and the current rails asset pipeline. if you already understand the asset pipeline and helper methods, then you’re good to go. Also, there is no dependacy on npm.
This is all you need to mount a React component to a spot on the page. That is this helper
<%= react_component("MyCoolWidget", prop1: "123", prop2: "abcd") %>
Other features include the ablitiy to render the components on the server for faster rendering and SEO, rendering a component as a view and writing your components in es2015 syntax or coffeescript.