From 549839ddc21a9169aeadd2aa7a9b4f3a20d340aa Mon Sep 17 00:00:00 2001 From: hiromieguchi802-lab Date: Tue, 24 Mar 2026 10:41:07 +0800 Subject: [PATCH 1/2] docs: clarify useFormContext formState subscriptions --- src/content/docs/useformcontext.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content/docs/useformcontext.mdx b/src/content/docs/useformcontext.mdx index 5b59d12e9..d5b3c258d 100644 --- a/src/content/docs/useformcontext.mdx +++ b/src/content/docs/useformcontext.mdx @@ -34,6 +34,12 @@ const methods = useFormContext() // retrieve those props You need to wrap your form with the [`FormProvider`](/docs/formprovider) component for `useFormContext` to work properly. + + If you need to subscribe to form state values like `errors`, `isDirty`, or + `dirtyFields` inside a `FormProvider` tree, use + [`useFormState`](/docs/useformstate) instead of destructuring `formState` + from `useFormContext()`. `formState` is wrapped with a Proxy, so you should + read the specific state you want to subscribe to before render. **Example:** From 77e1e16a637075bb6bbcde6f03ee4fe8b53a30bc Mon Sep 17 00:00:00 2001 From: hiromieguchi802-lab <270042125+hiromieguchi802-lab@users.noreply.github.com> Date: Fri, 27 Mar 2026 09:42:21 +0800 Subject: [PATCH 2/2] docs: format useFormContext note --- src/content/docs/useformcontext.mdx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/content/docs/useformcontext.mdx b/src/content/docs/useformcontext.mdx index d5b3c258d..4f94f56d3 100644 --- a/src/content/docs/useformcontext.mdx +++ b/src/content/docs/useformcontext.mdx @@ -35,11 +35,12 @@ const methods = useFormContext() // retrieve those props You need to wrap your form with the [`FormProvider`](/docs/formprovider) component for `useFormContext` to work properly. - If you need to subscribe to form state values like `errors`, `isDirty`, or - `dirtyFields` inside a `FormProvider` tree, use - [`useFormState`](/docs/useformstate) instead of destructuring `formState` - from `useFormContext()`. `formState` is wrapped with a Proxy, so you should - read the specific state you want to subscribe to before render. +If you need to subscribe to form state values like `errors`, `isDirty`, or +`dirtyFields` inside a `FormProvider` tree, use +[`useFormState`](/docs/useformstate) instead of destructuring `formState` +from `useFormContext()`. `formState` is wrapped with a Proxy, so you should +read the specific state you want to subscribe to before render. + **Example:**