-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
connect() returns an object #1300
Comments
Yes, as of React-Redux v7, Also, please make sure that you don't have duplicate copies of React in your tree, and that React truly is on React 16.8.x. |
Thanks for the rapid assistance! In the Isn't it enought? |
Should be, yes. If you can create a sample project that reproduces the issue (preferably as a CodeSandbox), I can maybe take a quick look. |
Thanks to |
@markerikson is there any way to turn it off? I use the old react-router and it warns "Invalid prop |
@finom : no. If you're using an older version of React-Router, you need to either upgrade the router version, or stick with an older version of React-Redux. |
Yes. I found this today. And it is a pretty big issue unfortunately. withStyles() from material-ui also uses this memo, breaking some of my code. Upgrading react-router is the way to go. But I use react-router-dom 4.3.1 and it does render but I get an error in the console: EDIT: I updated to react-router-dom 5.0.1 and now it works without errors in the console. Fixed somewhere between 4.3.1 and 5.0.1 of react-router-dom. |
Hello guys, I've found a solution to make it work with the old react-router and I suppose this should also work other outdated libraries. The solution is just to wrap the returned memorized component with a stateless component which isn't enhanced by const NonMemorizedNotFoundErrorPage = props => <NotFoundErrorPage {...props} />;
...
<Route path="/*" component={NonMemorizedNotFoundErrorPage} /> |
It seems to be fixed in 5.0.0 as per the release notes and this version did fix the issue for me. |
I'm using these libraries:
I have a simple component (Typescript):
And I have a parent component:
For some reason the
connect(mapStateToProps)(ExampleComponent)
returns anobject
instead of React component.I am getting an error:
Also when I trying to do
console.info(typeof connect(mapStateToProps)(ExampleComponent))
it printsobject
to the console.How can I solve this issue?
The text was updated successfully, but these errors were encountered: