class ReactComponent < ApplicationComponent erb_template <<-ERB <% if content? %> props="<%= @props.to_json %>"><%= content %> <% else %> props="<%= @props.to_json %>"> <% end %> ERB def initialize(name, **props) @name = name @props = props end end