From 268d49d8a2e6261b6126b8db7d8fcbbc60c037f6 Mon Sep 17 00:00:00 2001 From: Abanoub Ghadban Date: Fri, 6 Dec 2024 12:59:57 +0200 Subject: [PATCH] revert commiting some lines --- lib/react_on_rails/helper.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/react_on_rails/helper.rb b/lib/react_on_rails/helper.rb index fa3159dd7..852d9ef0e 100644 --- a/lib/react_on_rails/helper.rb +++ b/lib/react_on_rails/helper.rb @@ -361,14 +361,13 @@ def load_pack_for_generated_component(react_component_name, render_options) return unless render_options.auto_load_bundle ReactOnRails::PackerUtils.raise_nested_entries_disabled unless ReactOnRails::PackerUtils.nested_entries? - append_javascript_pack_tag("client-bundle") - # if Rails.env.development? - # is_component_pack_present = File.exist?(generated_components_pack_path(react_component_name)) - # raise_missing_autoloaded_bundle(react_component_name) unless is_component_pack_present - # end - # append_javascript_pack_tag("generated/#{react_component_name}", - # defer: ReactOnRails.configuration.defer_generated_component_packs) - # append_stylesheet_pack_tag("generated/#{react_component_name}") + if Rails.env.development? + is_component_pack_present = File.exist?(generated_components_pack_path(react_component_name)) + raise_missing_autoloaded_bundle(react_component_name) unless is_component_pack_present + end + append_javascript_pack_tag("generated/#{react_component_name}", + defer: ReactOnRails.configuration.defer_generated_component_packs) + append_stylesheet_pack_tag("generated/#{react_component_name}") end # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity