Skip to content

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

@IgorCRD

Description

@IgorCRD

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions