diff --git a/lib/react_on_rails/helper.rb b/lib/react_on_rails/helper.rb index de6ae5509..cc56716d9 100644 --- a/lib/react_on_rails/helper.rb +++ b/lib/react_on_rails/helper.rb @@ -537,8 +537,8 @@ def raise_prerender_error(json_result, react_component_name, props, js_code) end def should_raise_streaming_prerender_error?(chunk_json_result, render_options) - chunk_json_result["hasErrors"] && - ((render_options.raise_on_prerender_error && !chunk_json_result["isShellReady"]) || + chunk_json_result["hasErrors"] && + ((render_options.raise_on_prerender_error && !chunk_json_result["isShellReady"]) || (render_options.raise_non_shell_server_rendering_errors && chunk_json_result["isShellReady"])) end @@ -594,15 +594,13 @@ def server_rendered_react_component(render_options) if should_raise_streaming_prerender_error?(chunk_json_result, render_options) raise_prerender_error(chunk_json_result, react_component_name, props, js_code) end - # It doesn't make any transformation, it listens to the streamed chunks and raise error if it has errors + # It doesn't make any transformation, it listens to the streamed chunks and raise error if it has errors chunk_json_result end - else - if result["hasErrors"] && render_options.raise_on_prerender_error - raise_prerender_error(result, react_component_name, props, js_code) - end + elsif result["hasErrors"] && render_options.raise_on_prerender_error + raise_prerender_error(result, react_component_name, props, js_code) end - + result end diff --git a/lib/react_on_rails/react_component/render_options.rb b/lib/react_on_rails/react_component/render_options.rb index 8a8a628ab..86b53a205 100644 --- a/lib/react_on_rails/react_component/render_options.rb +++ b/lib/react_on_rails/react_component/render_options.rb @@ -132,6 +132,7 @@ def retrieve_configuration_value_for(key) def retrieve_react_on_rails_pro_config_value_for(key) options.fetch(key) do return nil unless ReactOnRails::Utils.react_on_rails_pro? + ReactOnRailsPro.configuration.public_send(key) end end