Skip to content

Commit

Permalink
docs: ✏️ Add defaultValues to input in form examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbrachotte committed Oct 10, 2023
1 parent 43c4023 commit f8b14d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/www/registry/default/example/input-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const FormSchema = z.object({
export default function InputForm() {
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {
username: "",
},
})

function onSubmit(data: z.infer<typeof FormSchema>) {
Expand Down
3 changes: 3 additions & 0 deletions apps/www/registry/new-york/example/input-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const FormSchema = z.object({
export default function InputForm() {
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {
username: "",
},
})

function onSubmit(data: z.infer<typeof FormSchema>) {
Expand Down

0 comments on commit f8b14d2

Please sign in to comment.