useCustom hook info
How to fire useCustom hook programatically depending on some action?
5 Replies
Hi @dreamer9067. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the useCustom documentation (https://refine.dev/docs/api-reference/core/hooks/data/useCustom/) for more details on how to use this hook.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@560876002046377984> kapa.ai is still learning and improving, please let us how it did by reacting below
national-goldOP•2y ago
@kapa.ai can u give any example of a component with useCustom hook??
Let me check the knowledge base for you. One moment! :books:
----------------------
I'm sorry, but the provided extracts do not include a specific example of a component using the
useCustom
hook. However, the useCustom documentation (https://refine.dev/docs/api-reference/core/hooks/data/useCustom/) provides a detailed explanation of how to use this hook. It's used to send custom query requests and it uses the custom
method as the query function from the dataProvider
.
Please note that useCustom
should not be used when creating, updating, or deleting a resource. For these operations, you should use the useCreate (https://refine.dev/docs/api-reference/core/hooks/data/useCreate/), useUpdate (https://refine.dev/docs/api-reference/core/hooks/data/useUpdate/) or useDelete (https://refine.dev/docs/api-reference/core/hooks/data/useDelete/) hooks instead.
If you need to customize the mutation request, you should use the useCustomMutation (https://refine.dev/docs/api-reference/core/hooks/data/useCustomMutation/) hook.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@560876002046377984> kapa.ai is still learning and improving, please let us how it did by reacting below