deep-jade
deep-jade6mo ago

About the useForm hook

Is the “useForm” hook under refinedev/core and refinedev/antd packages the same?
2 Replies
kapa.ai
kapa.ai6mo ago
Hi @kevincostnr. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The useForm hook under @refinedev/core and @refinedev/antd packages are related but not exactly the same. The useForm hook from @refinedev/core is the foundational hook that provides core functionalities for form management, such as handling form submission, data fetching, caching, state management, and server-side error handling. This core hook is the basis for all other useForm implementations in the Refine ecosystem.
import { useForm } from "@refinedev/core";
import { useForm } from "@refinedev/core";
(Source: useForm - Refine Core (https://refine.dev/docs/data/hooks/use-form/)) On the other hand, the useForm hook from @refinedev/antd is an extended version of the core useForm hook. It is specifically tailored to work with Ant Design's form components, providing additional features and integrations that are specific to Ant Design, such as validation, error handling, and form values management.
import { useForm } from "@refinedev/antd";
import { useForm } from "@refinedev/antd";
(Source: useForm - Ant Design (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-form/)) In summary, while the useForm hook in @refinedev/antd builds upon the core functionalities provided by @refinedev/core, it includes additional features and integrations specific to Ant Design forms. For more detailed information, you can refer to the respective documentation: - useForm - Refine Core (https://refine.dev/docs/data/hooks/use-form/) - useForm - Ant Design (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-form/) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@1244320027532988427> kapa.ai is still learning and improving, please let us know how it did by reacting below

Did you find this page helpful?