From dd94aa936fca8421835cf9f97c62ece49a85cc68 Mon Sep 17 00:00:00 2001 From: onurhan <60575283+onurhan1337@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:16:22 +0300 Subject: [PATCH] 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 --- apps/www/content/docs/components/form.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/www/content/docs/components/form.mdx b/apps/www/content/docs/components/form.mdx index 02824dd144..93d74e1dad 100644 --- a/apps/www/content/docs/components/form.mdx +++ b/apps/www/content/docs/components/form.mdx @@ -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 `
` 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"