diff --git a/lib/react/rails/component_mount.rb b/lib/react/rails/component_mount.rb index 9d5faddb3..c09336473 100644 --- a/lib/react/rails/component_mount.rb +++ b/lib/react/rails/component_mount.rb @@ -46,7 +46,15 @@ def react_component(name, props = {}, options = {}, &block) # remove internally used properties so they aren't rendered to DOM html_options.except!(:tag, :prerender, :camelize_props) - content_tag(html_tag, '', html_options, &block) + rendered_tag = content_tag(html_tag, '', html_options, &block) + if React::ServerRendering.renderer_options[:replay_console] + # Grab the server-rendered console replay script + # and move it _outside_ the container div + rendered_tag.sub!(/\n(