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
{{ message }}
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
When trying to integrate redux into "react-progressive-hydration" it returns:
Invariant Violation: Could not find "store" in the context of "Connect(ReduxTest)". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to Connect(ReduxTest) in connect options.
The Provider is provided in client.js.
This is the component wrapped in your hydrator component
Thanks for opening an issue. This is caused by the Hydrate component failing to pass React Context down through the tree, which was something we skirted around to keep things simple for demonstration purposes. It is possible to stitch context across trees, however - hopefully we can get this repo updated with a version of Hydrate that does just that.
constwithPropsContext=Child=>classApplyContextextendsComponent{getChildContext(){returnthis.props.context;}render(){const{ context, ...props}=this.props;return<Child{...props}/>;}}constReduxTest=()=><div>TEST</div>// you only have to do this for the outermost hydrator child:exportdefaultwithPropsContext(connect(mapStateToProps)(ReduxTest))
Thank you very much for providing your samples!
When trying to integrate redux into "react-progressive-hydration" it returns:
Invariant Violation: Could not find "store" in the context of "Connect(ReduxTest)". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to Connect(ReduxTest) in connect options.
The Provider is provided in client.js.
This is the component wrapped in your hydrator component
Can you please explain the cause of this error? Do you have a workaround for this? Thank you very much in advance.
The text was updated successfully, but these errors were encountered: