From ac8b779eab4f4805b98f13ee4f6a96646d0796bf Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Wed, 7 Feb 2024 01:00:35 +0100 Subject: [PATCH] replace FormContext by FormProvider --- src/components/UseFormState.tsx | 2 +- src/components/codeExamples/useFieldArrayArgument.ts | 2 +- src/content/docs/usewatch.mdx | 2 +- src/data/generic.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/UseFormState.tsx b/src/components/UseFormState.tsx index bb2a6d276..d24e55bd4 100644 --- a/src/components/UseFormState.tsx +++ b/src/components/UseFormState.tsx @@ -71,7 +71,7 @@ const UseFormState = () => { control {" "} object provided by useForm. It's optional if - you are using FormContext. + you are using FormProvider. diff --git a/src/components/codeExamples/useFieldArrayArgument.ts b/src/components/codeExamples/useFieldArrayArgument.ts index 88dac8302..f730b7104 100644 --- a/src/components/codeExamples/useFieldArrayArgument.ts +++ b/src/components/codeExamples/useFieldArrayArgument.ts @@ -1,7 +1,7 @@ export default `function FieldArray() { const { control, register } = useForm(); const { fields, append, prepend, remove, swap, move, insert } = useFieldArray({ - control, // control props comes from useForm (optional: if you are using FormContext) + control, // control props comes from useForm (optional: if you are using FormProvider) name: "test", // unique name for your Field Array }); diff --git a/src/content/docs/usewatch.mdx b/src/content/docs/usewatch.mdx index 154b73376..679102693 100644 --- a/src/content/docs/usewatch.mdx +++ b/src/content/docs/usewatch.mdx @@ -15,7 +15,7 @@ Behaves similarly to the `watch` API, however, this will isolate re-rendering at | Name | Type | Description | | -------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | string \| string[] \| undefined | Name of the field. | -| `control` | Object | [`control`](/docs/useform/control) object provided by `useForm`. It's optional if you are using FormContext. | +| `control` | Object | [`control`](/docs/useform/control) object provided by `useForm`. It's optional if you are using `FormProvider`. | | `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. | diff --git a/src/data/generic.tsx b/src/data/generic.tsx index 0d8eb3adb..e79b25b2a 100644 --- a/src/data/generic.tsx +++ b/src/data/generic.tsx @@ -49,7 +49,7 @@ export default { control {" "} object provided by useForm. It's optional if you are using - FormContext. + FormProvider. ), }