Skip to content

Commit 50a3cc3

Browse files
Fix redux_store to get immediate_hydration from Pro config
The redux_store helper method was still trying to get immediate_hydration from core ReactOnRails configuration. Updated to get it from Pro config when available, and default to false otherwise. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent e248263 commit 50a3cc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/react_on_rails/helper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,10 @@ def react_component_hash(component_name, options = {})
253253
# immediate_hydration: false -- React on Rails Pro (licensed) feature. Pass as true if you wish to
254254
# hydrate this store immediately instead of waiting for the page to load.
255255
def redux_store(store_name, props: {}, defer: false, immediate_hydration: nil)
256-
immediate_hydration = ReactOnRails.configuration.immediate_hydration if immediate_hydration.nil?
256+
if immediate_hydration.nil? && ReactOnRails::Utils.react_on_rails_pro?
257+
immediate_hydration = ReactOnRailsPro.configuration.immediate_hydration
258+
end
259+
immediate_hydration = false if immediate_hydration.nil?
257260

258261
redux_store_data = { store_name: store_name,
259262
props: props,

0 commit comments

Comments
 (0)