Skip to content

Types for connect class based components#100

Closed
lukelindsey wants to merge 22 commits intodevelopit:masterfrom
lukelindsey:master
Closed

Types for connect class based components#100
lukelindsey wants to merge 22 commits intodevelopit:masterfrom
lukelindsey:master

Conversation

@lukelindsey
Copy link

Fixes an issue where typescript won't allow connecting a class based component as the types were written only for SFC. Example error is below.

Argument of type 'typeof MyClassBasedComponent' is not assignable to parameter of type '(props: OwnProps & PropsFromStore) => VNode<any>'. Type 'typeof MyClassBasedComponent' provides no match for the signature '(props: OwnProps & PropsFromStore): VNode<any>'.

@kohlmannj
Copy link

This might be a dupe of #102 (and vice versa?).

@lukelindsey
Copy link
Author

@kohlmannj I'd say you're right. The only difference is I have leveraged the existing typings from preact itself, so it's a little cleaner and easier to understand. Both solutions work for me. @namankheterpal do you agree about closing #102 or is there another difference that I'm missing?

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

Successfully merging this pull request may close these issues.

2 participants