From 958a0fdb18a1fb16c88b078293e62ba8897319f2 Mon Sep 17 00:00:00 2001 From: N8 Date: Sat, 21 Oct 2023 13:57:26 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20Add=20defaultValue?= =?UTF-8?q?s=20to=20input=20in=20form=20examples=20(#1610)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/shadcn-ui/ui/issues/1609 --- apps/www/registry/default/example/input-form.tsx | 3 +++ apps/www/registry/new-york/example/input-form.tsx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/www/registry/default/example/input-form.tsx b/apps/www/registry/default/example/input-form.tsx index 18ba7441e1b..1ea1bb7b3c4 100644 --- a/apps/www/registry/default/example/input-form.tsx +++ b/apps/www/registry/default/example/input-form.tsx @@ -26,6 +26,9 @@ const FormSchema = z.object({ export default function InputForm() { const form = useForm>({ resolver: zodResolver(FormSchema), + defaultValues: { + username: "", + }, }) function onSubmit(data: z.infer) { diff --git a/apps/www/registry/new-york/example/input-form.tsx b/apps/www/registry/new-york/example/input-form.tsx index 4a9e32c96db..4be9df22364 100644 --- a/apps/www/registry/new-york/example/input-form.tsx +++ b/apps/www/registry/new-york/example/input-form.tsx @@ -26,6 +26,9 @@ const FormSchema = z.object({ export default function InputForm() { const form = useForm>({ resolver: zodResolver(FormSchema), + defaultValues: { + username: "", + }, }) function onSubmit(data: z.infer) {