const form = useForm<Partial<Recipe>>({
defaultValues: {
name: name ?? "",
description: description ?? "",
instructions: instructions ?? "",
categories: [...(recipe?.categories ?? [])],
ingredients: [...(recipeIngredients ?? [])],
steps: [...(recipe?.steps ?? [])],
},
onSubmit: async ({ value }) => {
await onSubmitHandler(value);
},
});
const form = useForm<Partial<Recipe>>({
defaultValues: {
name: name ?? "",
description: description ?? "",
instructions: instructions ?? "",
categories: [...(recipe?.categories ?? [])],
ingredients: [...(recipeIngredients ?? [])],
steps: [...(recipe?.steps ?? [])],
},
onSubmit: async ({ value }) => {
await onSubmitHandler(value);
},
});