You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We allow defining the redux store in the controller, before the view renders. We can use the same api:
redux_store(store_name,props={})
We provide a new helper redux_store_hydration_data which takes no parameters. This client renders the redux store registered at the controller level. Put at end of your layout so that browser is not blocked reading your props for client side hydration. I.e., the browser can render your server rendered React before trying to parse props. Best to place this on your main Rails layout. This generates nothing if there's no stores being initialized by the controller. Note, while multiple stores would be rendered, a best practice is to have only one store.
This will be better for performance because the store is defined in the controller (for server rendering), and we can render the dom element with the store for the page updated callback at the very end of the page dom.
redux_store_hydration_data ==> put at end of your layout so that browser is not blocked reading your props for client side hydration. I.e., the browser can render your server rendered React before trying to parse props.
I'm going to make the following API changes:
Shared Stores
We allow defining the redux store in the controller, before the view renders. We can use the same api:
We provide a new helper
redux_store_hydration_data
which takes no parameters. This client renders the redux store registered at the controller level. Put at end of your layout so that browser is not blocked reading your props for client side hydration. I.e., the browser can render your server rendered React before trying to parse props. Best to place this on your main Rails layout. This generates nothing if there's no stores being initialized by the controller. Note, while multiple stores would be rendered, a best practice is to have only one store.redux_store_hydration_data
Allow calling getStore to return undefined
The text was updated successfully, but these errors were encountered: