diff --git a/src/components/ApiGallery.tsx b/src/components/ApiGallery.tsx index 2cbd410fc..a7dd70fa2 100644 --- a/src/components/ApiGallery.tsx +++ b/src/components/ApiGallery.tsx @@ -18,7 +18,7 @@ export default function ApiGallery() { if (version !== 7) { router.push( - `https://react-hook-form-website-git-leagcy-hook-form.vercel.app/${version}/api` + `https://react-hook-form-website-git-leagcy-hook-form.vercel.app/v${version}/api` ) } else { router.push(`/v${version}/docs/`) diff --git a/src/content/docs/useformstate/errormessage.mdx b/src/content/docs/useformstate/errormessage.mdx index a3e67ff44..69227c022 100644 --- a/src/content/docs/useformstate/errormessage.mdx +++ b/src/content/docs/useformstate/errormessage.mdx @@ -155,15 +155,18 @@ export default function App() { ``` ```javascript copy sandbox="https://codesandbox.io/s/react-hook-form-v7-errormessage-multiple-error-messages-lnvkt" -import { useForm } from "react-hook-form"; -import { ErrorMessage } from '@hookform/error-message'; - +import { useForm } from "react-hook-form" +import { ErrorMessage } from "@hookform/error-message" export default function App() { - const { register, formState: { errors }, handleSubmit } = useForm({ - criteriaMode: "all" - }); - const onSubmit = data => console.log(data); + const { + register, + formState: { errors }, + handleSubmit, + } = useForm({ + criteriaMode: "all", + }) + const onSubmit = (data) => console.log(data) return (
@@ -172,12 +175,12 @@ export default function App() { required: "This is required.", pattern: { value: /d+/, - message: "This input is number only." + message: "This input is number only.", }, maxLength: { value: 10, - message: "This input exceed maxLength." - } + message: "This input exceed maxLength.", + }, })} /> - - ); + ) } - ``` diff --git a/src/content/docs/usewatch/watch.mdx b/src/content/docs/usewatch/watch.mdx index b50f6a693..bf327bb5b 100644 --- a/src/content/docs/usewatch/watch.mdx +++ b/src/content/docs/usewatch/watch.mdx @@ -20,31 +20,31 @@ A React Hook Form component that provides the same functionality as `useWatch`, | `defaultValue` | unknown | default value for `useWatch` to return before the initial render.

**Note:** the first render will always return `defaultValue` when it's supplied. | | `disabled` | boolean = false | Option to disable the subscription. | | `exact` | boolean = false | This prop will enable an exact match for input name subscriptions. | -| `render` | Function | Subscribes to specified form field(s) and re-renders its child function whenever the values change. This allows you to declaratively consume form values in JSX without manually wiring up state. | +| `render` | Function | Subscribes to specified form field(s) and re-renders its child function whenever the values change. This allows you to declaratively consume form values in JSX without manually wiring up state. | **Examples:** --- ```tsx copy sandbox="" -import { useForm, Watch } from 'react-hook-form'; +import { useForm, Watch } from "react-hook-form" const App = () => { - const { register, control } = useForm(); + const { register, control } = useForm() return (
- - + +
{/* re-render only when value of `foo` changes */} {foo}} />
- ); -}; + ) +} ```