mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-29 15:44:22 +00:00
fix(docs): present useForm when copy form (#1486)
When I tried it after the attached issue, I realized; For someone who's absolutely copying and pasting form the guide, this would give an error, as useForm is not imported in the guide. So I fixed that. Related issue: https://github.com/shadcn-ui/ui/issues/1482 Fix #1482
This commit is contained in:
@@ -141,6 +141,7 @@ Use the `useForm` hook from `react-hook-form` to create a form.
|
||||
"use client"
|
||||
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import * as z from "zod"
|
||||
|
||||
const formSchema = z.object({
|
||||
@@ -177,6 +178,7 @@ We can now use the `<Form />` components to build our form.
|
||||
"use client"
|
||||
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { useForm } from "react-hook-form"
|
||||
import * as z from "zod"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
Reference in New Issue
Block a user