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

Part of #150 : add typings for useMedia #151

Merged
merged 3 commits into from
Jun 10, 2020
Merged

Part of #150 : add typings for useMedia #151

merged 3 commits into from
Jun 10, 2020

Conversation

abenhamdine
Copy link
Contributor

@abenhamdine abenhamdine commented Jun 10, 2020

see #150

works fine for me :

image

image

image

remark : with single query, we have to use the generic to type the result :

image

if not, result is typed unknown, TS seems unable to pick the first signature

image

@abenhamdine abenhamdine marked this pull request as ready for review June 10, 2020 13:20
@edorivai
Copy link
Collaborator

Interesting, it actually does seem to infer the correct function signature for me:
image

@edorivai edorivai merged commit 5fe3b7b into ReactTraining:master Jun 10, 2020
@abenhamdine
Copy link
Contributor Author

ah weird
FWIW I use ts 3.8.3

@edorivai
Copy link
Collaborator

Yeah I'm using the same version.

@edorivai
Copy link
Collaborator

Should be available at react-media@next or react-media@2.0.0-rc.1 btw

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

Successfully merging this pull request may close these issues.

2 participants