-
-
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
WrappedComponent.defaultProps is missing in mapStateToProps #111
Comments
class Foo extends React.Component {
render() {
return <div>this.props.bar</div>
}
}
Foo = connect(function mapStateToProps(state, props) {
console.log(props.bar)
})(Foo)
Foo.defaultProps = {
bar: 'baz'
}
module.exports = Foo; |
@gaearon shouldn't this be handled by the library? It doesn't feel very intuitive this way (especially when using decorators and static properties), and doing the opposite (by requiring to manually |
No, the current behavior makes sense based on both the tooling, the language syntax, and the conceptual idea of defining "original" components vs defining wrappers for them. |
The text was updated successfully, but these errors were encountered: