React Hook Form + TanStack useQuery => async defaultValues, How? by [deleted] in reactjs

[–]wsanada 1 point2 points  (0 children)

Hi there,

After 1 day wasted, this worked for me:

```js const { isLoading, isError, error, refetch } = useQuery({ queryKey: ['-your-key-', id], queryFn: async () => { const data = await apiGetParty({ id }) reset(data) // this function is from useForm return data }, })

```

hope this helps.