best way to use type UseMutationResult and UseQueryResult #6883
Unanswered
ShaneZhengNZ
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create my own wrapper around useMutation and useQuery, just so that I can do some common error handling, etc.
In this case, I have to import type UseMutationResult and UseQueryResult from "@tanstack/react-query".
but, I get the following warning:
transform[stderr]: The exported identifier "UseMutationResult" is not declared in Babel's scope tracker
transform[stderr]: as a JavaScript value binding, and "@babel/plugin-transform-typescript"
transform[stderr]: never encountered it as a TypeScript type declaration.
transform[stderr]: It will be treated as a JavaScript value.
transform[stderr]:
transform[stderr]: This problem is likely caused by another plugin injecting
transform[stderr]: "UseMutationResult" without registering it in the scope tracker. If you are the author
transform[stderr]: of that plugin, please use "scope.registerDeclaration(declarationPath)".
transform[stderr]: The exported identifier "UseQueryResult" is not declared in Babel's scope tracker
transform[stderr]: as a JavaScript value binding, and "@babel/plugin-transform-typescript"
transform[stderr]: never encountered it as a TypeScript type declaration.
transform[stderr]: It will be treated as a JavaScript value.
transform[stderr]:
transform[stderr]: This problem is likely caused by another plugin injecting
transform[stderr]: "UseQueryResult" without registering it in the scope tracker. If you are the author
transform[stderr]: of that plugin, please use "scope.registerDeclaration(declarationPath)".
any suggested fixes?
Beta Was this translation helpful? Give feedback.
All reactions