I am trying to use react-query with TypeScript and providing the result of a request with a ts interface. Now I have the following problem
But I can't access it, because I specified the result in an interface
- Edit: I forgot to add the hook and interface.
CodePudding user response:
Ok, I fixed it. Added this to the fetchUser
function, Now it will return only the data and not the whole request.