Looking for Guidance on the Best Methods for Including React on Rails in a Big Application

Hello Everyone :hugs:,

I’m currently working on a large-scale application that we are developing using Ruby on Rails, and we’re planning to integrate React as the front-end framework. I’ve come across the React on Rails gem and I’m interested in using it for our project, but since this is a fairly substantial application with many moving parts, I want to make sure we approach the integration in the most efficient way possible.

I have a few specific questions, but I’m also open to any general advice that those of you with experience using React on Rails in large applications might have:

  1. Performance Considerations: Are there any performance pitfalls I should be aware of when using React on Rails at scale? How do you manage rendering heavy React components without slowing down the server-side rendering process?
  2. State Management: When dealing with complex applications, managing the state across various components can be tricky. Do you recommend any particular libraries or patterns that work well with React on Rails for handling global state management? I’ve been considering Redux, but I’m curious if there are better alternatives for this setup.
  1. Server-Side Rendering (SSR) Best Practices: We are planning to implement SSR for SEO and initial load time benefits. Are there any best practices for setting up SSR with React on Rails that you’ve found particularly helpful? How do you handle the balance between client and server-side rendering?
  2. Deployment and Maintenance: How do you handle deployment and ongoing maintenance when using React on Rails, especially in a production environment? Are there any specific tools or mendix rapid techniques you recommend to streamline this process?

Thanks in advance for your insights and suggestions. Looking forward to learning from your experiences!