quickest-silver
quickest-silver15mo ago

useForm

I build a custom hook that generates the form my problem is if i created a new record , then i clicked the edit button the data will be loaded successfully but get back then clicked the edit button for the same record the data will not be loaded which mean all the inputs are empty i tried to console the getValues() function I see at the first time it loads the form then it bring the data from api but the second click will not fetch the data from the api that's my problem
6 Replies
kapa.ai
kapa.ai15mo ago
Hi @saji_nael. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai15mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, I can provide you with some general guidance based on the information extracts. When using refine, it's important to ensure that you're passing the record id to the show function when clicking the Edit button. This is necessary for both "edit" and "clone" forms. You can find examples of this in the following extracts: - useDrawerForm with Ant Design (https://refine.dev/docs/api-reference/antd/hooks/form/useDrawerForm) - useDrawerForm with Mantine (https://refine.dev/docs/api-reference/mantine/hooks/form/useDrawerForm) - useModalForm with Ant Design (https://refine.dev/docs/api-reference/antd/hooks/form/useModalForm) - useModalForm with Mantine (https://refine.dev/docs/api-reference/mantine/hooks/form/useModalForm) If you're still having issues, I recommend reviewing the refine documentation (https://refine.dev/docs) for more information on how to properly set up your forms and handle data fetching. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
useDrawerForm | refine
useDrawerForm hook allows you to manage a form within a Drawer. It returns Ant Design and components props.
useDrawerForm | refine
useModalForm hook allows you to manage a form within a as well as a . It provides some useful methods to handle the form or form .
useModalForm | refine
useModalForm hook allows you to manage a form within a . It returns Ant Design and Modal components props.
useModalForm | refine
useModalForm hook also allows you to manage a form inside a modal component. It provides some useful methods to handle the form modal.
Overview | refine
What is refine?
kapa.ai
kapa.ai15mo ago
<@1000087684632547538> kapa.ai is still learning and improving, please let us how it did by reacting below
wise-white
wise-white15mo ago
Hello @saji_nael, can you provide us a minimal reproducible stackblitz example so we can help?
quickest-silver
quickest-silver15mo ago
hi , I solved the issue thanks
wise-white
wise-white15mo ago
Hello @saji_nael , I'm happy your issue is solved, if you can give some details for future reference, would be great!