queryResult without values
im using the useShow an follow the documentation i can do this:
const { data, isLoading, isError } = queryResult;
const task = data?.data;
but my const task is undefined, how can i do?

3 Replies
Hi @mauryo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The
queryResult
object returned by the useShow
hook should contain the data
property if the request was successful. If task
is undefined
, it could mean that the request failed, or the data returned from the server doesn't have the expected structure.
Here are a few things you can check:
1. Check if there's an error: If isError
is true
, then the request failed. You should check the error message for more details.
2. Check if the request is still loading: If isLoading
is true
, then the request is still in progress and data
might not be available yet.
3. Check the structure of the returned data: The useShow
hook expects the data from the server to be in a specific format. If your server returns data in a different format, you might need to adjust your code accordingly.
Here's an example of how you can check these conditions:
If none of these checks help, you might want to log the entire queryResult
object to see what it contains:
This should give you more information about what's going wrong.
Sources:
- Github Issue (closed): [BUG] useShow does not query when given a specific resource name. > Original post (https://github.com/refinedev/refine/issues/2463)
- Github Issue (closed): [FEAT] Differentiate between refetch() and normal query > Comments Part 3 (https://github.com/refinedev/refine/issues/2095)
- Documentation > Docs > Guides-concepts > Routing > Relationship Between Resources and Routes Check the guidePlease check the guide for more information on this topic. > Code Files Part 3 (https://refine.dev/docs/guides-concepts/routing#relationship-between-resources-and-routes-)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@737073867532796026> kapa.ai is still learning and improving, please let us know how it did by reacting below
conscious-sapphire•11mo ago
I installed remix-MUI-strapi, got this error: ReferenceError: AppIcon is not defined
at Title (http://localhost:3000/build/routes/_layout-R6SGUJBE.js:246:171)
at renderWithHooks (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:11568:26)
at mountIndeterminateComponent (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:14946:21)
at beginWork (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:15934:22)
at beginWork$1 (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:19781:22)
at performUnitOfWork (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:19226:20)
at workLoopSync (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:19165:13)
at renderRootSync (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:19144:15)
at recoverFromConcurrentError (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:18764:28)
at performConcurrentWorkOnRoot (http://localhost:3000/build/_shared/chunk-PLT55Z5M.js:18712:30), how to fix?