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

typings: createInstance should return constructor function #57

Closed
harbeedev opened this issue Jun 23, 2019 · 4 comments
Closed

typings: createInstance should return constructor function #57

harbeedev opened this issue Jun 23, 2019 · 4 comments

Comments

@harbeedev
Copy link

Hi, I believe the typescript signature of createInstance should be:

export function createInstance<T>(defaultProps?: AsyncProps<T>): new() => Async<T>

I have tested this locally, and I'm happy to create a pull request if needed.

@ghengeveld
Copy link
Member

Yes, that looks good. Better than what we have now at least. Unfortunately it doesn't work with the helper components:

Schermafbeelding 2019-06-24 om 17 10 12

Please create a PR. Would be great if you can fix the static members as well. I've struggled with typing these in the past and I'm still not comfortable with creating types for that kind of thing.

@ghengeveld
Copy link
Member

ghengeveld commented Jun 24, 2019

It's not about the Async<unknown> by the way, if I provide a promiseFn that resolves to a string it's still the same error (just with Async<string>).

@ghengeveld
Copy link
Member

@harbeedev Will you create a pull request? Let's ignore the subcomponents for now, hopefully somebody will come up with a fix for that.

@ghengeveld
Copy link
Member

Fixed in v7.0.4

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