Skip to content

Commit

Permalink
make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AbanoubGhadban committed Jul 28, 2024
1 parent f201f02 commit 9ed4ce3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/react_on_rails/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,12 @@ def build_react_component_result_for_server_streamed_content(
rendered_html_stream = rendered_html_stream.transform do |chunk|
if is_first_chunk
is_first_chunk = false
next <<-HTML
html_content = <<-HTML
#{rails_context_if_not_already_rendered}
#{component_specification_tag}
<#{content_tag_options_html_tag} id="#{render_options.dom_id}">#{chunk}</#{content_tag_options_html_tag}>
HTML
html_content.strip
end
chunk
end
Expand Down
2 changes: 1 addition & 1 deletion node_package/src/serverRenderReactComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ See https://github.com/shakacode/react_on_rails#renderer-functions`);
}

renderResult = new PassThrough();
ReactDOMServer.renderToPipeableStream(reactRenderingResult as ReactElement).pipe(renderResult);
ReactDOMServer.renderToPipeableStream(reactRenderingResult).pipe(renderResult);

// TODO: Add console replay script to the stream
// Ensure to avoid console messages leaking between different components rendering
Expand Down

0 comments on commit 9ed4ce3

Please sign in to comment.