I am refactoring a piece of code and it shows this type of error whenever I try to import "react-query
I ran into the same thing and had to downgrade to version 3.
npm i react-query@3
Or for 4+
npm i @tanstack/react-query
It's because you are importing into a TypeScript file and it can't find the type declaration for the imported module. Normally all you need to do is to follow the given instructions and open a command prompt, go to the directory D:\overview and type:
npm i --save-dev @types/react-query
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With