-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix AnyComponent Type problem #1088
Conversation
AnyComponent type should be FunctionalComponent or ComponentConstructor.
We could merge both |
preact-redux |
@zD98 Do you think we could add a test for this? function HOCWrapper<T>(Wrappable: AnyComponent<T>): AnyComponent(T) {
...
} |
@zD98 I'd love to merge this as this is the right fix. Would you be willing to add a tiny test case for this? Something like @scurker suggested or: class Foo extends Component {
render() {
return <div>Hello</div>
}
}
function Bar() {
return <div>World</div>
}
const a: AnyComponent = Foo;
const b: AnyComponent = Bar; |
@marvinhagemeister It's been a bit since the original request, so I went ahead and created a duplicate PR #1249 with the necessary test. |
Closing this PR as @scurker made a new one with the tests added. Thanks to everyone for working on a fix and getting to the bottom of it :) |
AnyComponent type should be FunctionalComponent or ComponentConstructor.