turbo-mount-react

Embed React components in Rails views with Turbo navigation lifecycle management.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Grupo-AFAL/claude-plugins --skill turbo-mount-react
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turbo-mount-react
Source: https://github.com/Grupo-AFAL/claude-plugins/tree/main/rails-tools/skills/turbo-mount-react
Command: npx skills add https://github.com/Grupo-AFAL/claude-plugins --skill turbo-mount-react

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Integrating React into a Hotwire-first Rails application can lead to navigation breaks, oversized bundles, and fragile lifecycle management; this Skill shows how to keep Hotwire as the foundation while introducing isolated React islands only where genuinely needed.

Core Features & Use Cases

  • Islands architecture: mount isolated React components inside Rails views so they auto-mount and unmount correctly during Turbo navigation.
  • Secure data exchange: guidance for serializing ActiveRecord objects into plain props and performing CSRF-aware fetches between React and Rails.
  • Build, registration, and performance: instructions for configuring esbuild or Vite, registering components, lazy loading heavy bundles, testing mounts, and avoiding common memory leaks.
  • Example use cases: embedding a React Flow diagram, a rich data grid, or a canvas-based editor into a mostly Hotwire application without replacing Turbo navigation.

Quick Start

Add a turbo-mounted React component to a Rails view, register the component in your JavaScript entry point, and serialize props to plain objects so the component mounts and communicates securely with Rails.

Frequently Asked Questions about turbo-mount-react

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I embed React components into Rails views without breaking Turbo navigation?

Embed React components into Rails views using an islands architecture that automatically mounts and unmounts isolated widgets during Turbo navigation, preserving Hotwire as the foundation while preventing navigation breaks.

What is the best way to add interactive React widgets to a Hotwire Rails application?

The best way to add interactive React widgets to a Hotwire application is using an islands architecture, which mounts isolated React components only where needed, such as for diagrams, data grids, and rich editors, without replacing Turbo navigation.

How do I pass Rails ActiveRecord data to React components securely?

Pass Rails ActiveRecord data to React components by serializing objects into plain props and performing CSRF-aware fetches, ensuring secure data exchange between the React islands and the Rails backend.

Can I use esbuild or Vite to configure React islands in a Rails project?

Yes, you can configure React islands in a Rails project using either esbuild or Vite, which handles build tool configuration, component registration, and lazy loading of heavy bundles to optimize performance.

Why do my React components cause memory leaks during Turbo Drive navigation?

React components cause memory leaks during Turbo Drive navigation when they are not properly unmounted; using an automated islands architecture ensures correct mounting and unmounting lifecycle management during page transitions.

Does turbo-mount-react work with Turbo Streams for reactive updates?

Yes, the islands architecture is compatible with Turbo Streams, allowing Rails to push reactive updates while the embedded React components manage their own internal state and interactions securely.