@@ -344,10 +344,6 @@ def generated_components_pack_path(react_component_name)
344
344
"#{ ReactOnRails ::WebpackerUtils . webpacker_source_entry_path } /generated/#{ react_component_name } .js"
345
345
end
346
346
347
- def get_content_tag_options_html_tag ( render_options )
348
-
349
- end
350
-
351
347
def build_react_component_result_for_server_rendered_string (
352
348
server_rendered_html : required ( "server_rendered_html" ) ,
353
349
component_specification_tag : required ( "component_specification_tag" ) ,
@@ -380,24 +376,24 @@ def build_react_component_result_for_server_streamed_content(
380
376
component_specification_tag : required ( "component_specification_tag" ) ,
381
377
render_options : required ( "render_options" )
382
378
)
383
- content_tag_options_html_tag = render_options . html_options [ :tag ] || 'div'
384
379
# The component_specification_tag is appended to the first chunk
385
380
# We need to pass it early with the first chunk because it's needed in hydration
386
381
# We need to make sure that client can hydrate the app early even before all components are streamed
387
382
is_first_chunk = true
388
-
389
- rendered_html_stream = rendered_html_stream . prepend { rails_context_if_not_already_rendered }
390
- . prepend { "<#{ content_tag_options_html_tag } id=\" #{ render_options . dom_id } \" >" }
391
- . transform ( &:html_safe )
392
-
393
383
rendered_html_stream = rendered_html_stream . transform do |chunk |
394
- is_first_chunk = false
395
384
if is_first_chunk
396
- return "#{ chunk } \n #{ component_specification_tag } "
385
+ is_first_chunk = false
386
+ next "#{ chunk } \n #{ component_specification_tag } "
397
387
end
398
388
chunk
399
389
end
400
- . append { "</#{ content_tag_options_html_tag } >" }
390
+
391
+ content_tag_options_html_tag = render_options . html_options [ :tag ] || "div"
392
+ rendered_html_stream = rendered_html_stream . prepend { rails_context_if_not_already_rendered }
393
+ . prepend { "<#{ content_tag_options_html_tag } id=\" #{ render_options . dom_id } \" >" }
394
+ . transform ( &:html_safe )
395
+
396
+ rendered_html_stream . append { "</#{ content_tag_options_html_tag } >" }
401
397
. append { component_specification_tag }
402
398
# TODO: handle console logs
403
399
end
0 commit comments