Skip to content
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

forwardRef in decorator connect Error #1469

Closed
xuanheScript opened this issue Nov 22, 2019 · 1 comment
Closed

forwardRef in decorator connect Error #1469

xuanheScript opened this issue Nov 22, 2019 · 1 comment

Comments

@xuanheScript
Copy link

xuanheScript commented Nov 22, 2019

version: "react-redux": "6.0.1"
It Error:
@connect(mapStateToProps,mapDispatchToProps,null,{ forwardRef: true }) Component export default Component
It Correct:
export default connect(mapStateToProps,mapDispatchToProps,null,{ forwardRef: true })(Component)

Error Message: Expected a constructor

Why?

image

@markerikson
Copy link
Contributor

Sorry, we don't support or recommend using connect as a decorator. If it works, that's great, but it's not an intentionally supported use case since the decorator spec and plugins continue to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants