So how does React and Rails come together?
Rails structure follows the MVC pattern. React is the V in MVC.
So when a path hits a controller method (say index) for example, it will then try to find the view that corresponds to that method, so index.html.erb. Usually the file will contain html and embedded ruby code, but instead, we can use a react component if we use the react-rails gem. The page would look something like:
This will now render the AdminLessonsPage component, with @lessons_info sent down as a prop.
Simple as that! The rails side of the project is now seamlessly connected to the react side.