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

Typescript unable to find type definition for react-query/hydration even though they exist #970

Closed
IgorCRD opened this issue Sep 5, 2020 · 1 comment · Fixed by #974
Closed

Comments

@IgorCRD
Copy link

IgorCRD commented Sep 5, 2020

Hey, @tannerlinsley

I just found this library and I am liking the concepts very much. I am starting to use it on an new project. Thank you very much for your work.

I found this typescript problem when using it for SSR, I would submit a PR (I tried a few things but with no success), but I don't know how to solve this.

Describe the bug
When importing 'react-query/hydration' on a typescript project I am getting back this error...

Could not find a declaration file for module 'react-query/hydration'. '/Users/Igor/work/liquality/tliquality/node_modules/react-query/hydration.js' implicitly has an 'any' type.
  Try `npm install @types/react-query` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-query/hydration';`

To Reproduce
Steps to reproduce the behavior:

  1. Create a typescript project
  2. import 'react-query/hydration'

Expected behavior
Typescript should recognized the types from react-query/hydration

Desktop (please complete the following information):

  • OS: OSX

Additional context
Not sure if it matters, but I am using it in a NextJS project.

@jairenee
Copy link

I'm still encountering this issue. Does anything need to be done to mitigate this? I'm on react query 2.26.0

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 a pull request may close this issue.

2 participants