hi team, when i have the following code, it doesnt populate my form with current values in the db because it's undefined for 3 seconds before the values show up.
by then, the defaultValues in the useForm have already been populated with empty values. does anyone know how can i fix it?
in other words, how can i call the useForm hook after it finishes loading? thanks!
const myShop = useQuery(api.myShopFuncs.getmyShopProfile, {
clerkOrganizationId: orgId || "",
})
const createMyShopProfileMutation = useMutation(
api.myShopFuncs.createMyShopProfile
)
const form = useForm<MyShopFormValues>({
resolver: zodResolver(myShopSchema),
defaultValues: {
size: myShop?.size || "",
areas: myShop?.areas || [],
features: myShop?.features || [],
},
reValidateMode: "onBlur",
})