From c584f011633a397bf8dbaca2b7cf7606840db510 Mon Sep 17 00:00:00 2001 From: shadcn Date: Mon, 22 May 2023 13:43:29 +0400 Subject: [PATCH] docs(www): update defaultValues for useForm --- apps/www/content/docs/forms/react-hook-form.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/www/content/docs/forms/react-hook-form.mdx b/apps/www/content/docs/forms/react-hook-form.mdx index 9c9722e185..a03de0d148 100644 --- a/apps/www/content/docs/forms/react-hook-form.mdx +++ b/apps/www/content/docs/forms/react-hook-form.mdx @@ -111,7 +111,7 @@ const formSchema = z.object({ Use the `useForm` hook from `react-hook-form` to create a form. -```tsx showLineNumbers {4,14-17,19-24} +```tsx showLineNumbers {4,14-20,22-27} "use client" import Link from "next/link" @@ -128,6 +128,9 @@ export function ProfileForm() { // 1. Define your form. const form = useForm>({ resolver: zodResolver(formSchema), + defaultValues: { + username: "", + }, }) // 2. Define a submit handler.