-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redux-form v8.2.3 + react-redux v7.1.0 + react 16.8.6 + server-side rendering results in invalid hook call #4489
Comments
[email protected] has huge perf issue when you use it with redux-form@8, I use it in react-native app and it almost crashes after few typed chars in input field, rolled back to 7.0.3 fixed an issue. [email protected] is not ready yet to use with redux-form |
I rolled back to react_1 | Invariant Violation: Could not find "store" in the context of "Connect(Form(WithStyles(BarePreferredDatesForm)))". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(Form(WithStyles(BarePreferredDatesForm))) in connect options.
react_1 | at invariant (/usr/src/app/node_modules/invariant/invariant.js:40:15)
react_1 | at Connect.renderWrappedComponent (/usr/src/app/node_modules/react-redux/lib/components/connectAdvanced.js:172:32)
react_1 | at Connect.indirectRenderWrappedComponent (/usr/src/app/node_modules/react-redux/lib/components/connectAdvanced.js:168:21)
react_1 | at ReactDOMServerRenderer.render (/usr/src/app/build/webpack:/node_modules/react-dom/cjs/react-dom-server.node.development.js:3412:1)
react_1 | at ReactDOMServerRenderer.read (/usr/src/app/build/webpack:/node_modules/react-dom/cjs/react-dom-server.node.development.js:3161:1)
react_1 | at renderToString (/usr/src/app/build/webpack:/node_modules/react-dom/cjs/react-dom-server.node.development.js:3646:1) Again, this only happens on the backend, and it only happens with It's also unlikely to be an interaction with any other provider, because even when a |
Interestingly, the issue seems to have more to do with React's context API and webpack than it does with this library specifically. When I posted my last message, I'm still unclear on what the issue actually is, but it doesn't seem to be completely related to this library. I'll go ahead and close this. |
What is the current behavior?
When a
reduxForm
-wrapped component is on the render path on the server, you get an `Invariant violation: Invalid hook call."Oddly, it doesn't exist on the frontend. I can work around the issue by lazy-loading the offending components and deferring them to the frontend.
Here's the full trace:
Is this a known issue/incompatibility with
react-redux
v7x? Is that one of the issues associated with #4431? Where in the render path would it be calling the hook code inconnect
? Are there other workarounds?What is the expected behavior?
It'd be great if it rendered without an error.
What's your environment?
React: 16.8.6
react-redux: 7.1.0
redux-form: 8.2.3
node version: 10.15.1
environment: docker
The text was updated successfully, but these errors were encountered: