module ReactOnRails::Controller
def redux_store(store_name, props: {}, immediate_hydration: nil)
Be sure to include view helper `redux_store_hydration_data` at the end of your layout or view
immediate hydration, non-Pro users don't. Can be explicitly overridden.
immediate_hydration: React on Rails Pro (licensed) feature. When nil (default), Pro users get
to pass to the redux store.
props: Named parameter props which is a Ruby Hash or JSON string which contains the properties
JavaScript code.
store_name: name of the store, corresponding to your call to ReactOnRails.registerStores in your
use the same Redux store.
Separate initialization of store from react_component allows multiple react_component calls to
def redux_store(store_name, props: {}, immediate_hydration: nil) immediate_hydration = ReactOnRails::Utils.normalize_immediate_hydration(immediate_hydration, store_name, "Store") redux_store_data = { store_name: store_name, props: props, immediate_hydration: immediate_hydration } @registered_stores_defer_render ||= [] @registered_stores_defer_render << redux_store_data end