Edit Page fetches the Data from the REST API, but doesn't populate the form fields.

Hi, I'm trying to create a Edit form for my card. I'm using useForm . But it isn't populating the Form. I can confirm the Fetch was successful and the Data is there. But it isn't populating itself. I've attached the Screenshots. Afaik, it should populate the fields by itself after fetching the data right? any reason why it isn't? Thanks!
No description
No description
No description
No description
No description
kapa.ai
kapa.ai421d ago
Hey @thalfpant! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
kapa.ai
kapa.ai421d ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, I can provide you with some guidance based on the information extracts. When using useForm with action: "edit", it fetches the record data according to the id with useOne (https://refine.dev/docs/api-reference/core/hooks/data/useOne/) and returns the queryResult for you to fill the form. After the form is submitted, it updates the record with useUpdate (https://refine.dev/docs/api-reference/core/hooks/data/useUpdate/). You can find an example of using useForm with action: "edit" in the documentation (https://refine.dev/docs/api-reference/core/hooks/useForm). Make sure you're using the correct properties and methods from useForm to populate your form fields. If you're still having issues, I recommend reviewing the refine documentation (https://refine.dev/docs) and blog (https://refine.dev/blog) for more information and examples. ----------------------
useOne | refine
useOne is an extended version of TanStack Query's useQuery. It supports all the features of useQuery and adds some extra features.
Overview | refine
What is refine?
Blog | refine
A Docusaurus powered blog!
kapa.ai
kapa.ai421d ago
<@439051486597611531> kapa.ai is still learning and improving, please let us how it did by reacting below
xenial-black
xenial-black421d ago
When you give register("<field name>") field name should be same as your data. For example Can you try register("user.name")
exotic-emerald
exotic-emerald421d ago
it is the same.
No description
xenial-black
xenial-black421d ago
can you try controller please ? example: https://github.com/refinedev/refine/blob/next/examples/form-mui-use-form/src/pages/posts/edit.tsx#L49 i didn't tested but probably register not work with MUI. I looked react hook form documentation and they suggest controller too. our examples uses controller too https://react-hook-form.com/get-started/
More Posts
Hi, How can I access the URL parameter?Hi, I'm trying to access the URL parameter in the 1st SS. It'll be used to fetch data. I've tried `ucookieshi all I use useTable useForm and another hooks to get the data from the backend in the backend (nodHelp with "Failed to resolve '@refinedev/inferencer/mantine"?Hi, I'm trying to adapt Refine into an existing React project (bundled by Parcel). I'm struggling towhite screen only in iPhoneHello! The problem I have is when I open my site using the ngrok url on iPhone I see a white screenCLI is not generating page?So i use the cli to create resource, yes it does create component for the resource but not page? so Swizzle of DataProviderHey Refine-Team, when I want to swizzle DataProvider, the console just displays the option to swizzlAdding routerProvider to Refine v4 errors with useLocation being used outside of a routerI am trying to upgrade my project to v4 and I've been having lots of issues. Right now trying to useAdd Refine to an existing React project?I'm wondering what the best way is to add Refine to an existing project. I tried adding the CLI, How to use Refine with JavascriptHello, What do I have to do to setup Refine to use JavaScript instead of typescript? I have checked Display success toast notificationI have created auth provider and i implemented login functionality .when I login it display toast uHow can I customize useRegister onSuccess error toast notification message?This is the refine V4 source code for useRegister hook. There is error handling, which by default thSupabase Set role upon signup or signInWithOAuthHi again everyone, How to set claim for role in Supabase when user signup with email and password orResource in useCustomMutation successNotification parameterHow do I access or pass a resource name into useCustomMutation? I use this hook to have a reorderingUse more than one Supabase Table on one PageHey lovely Refine Team, I cant find how to use Data of two Supabase Tables on one Page.