Skip to content

docs: clarify useFormContext formState subscriptions#1197

Open
hiromieguchi802-lab wants to merge 2 commits intoreact-hook-form:masterfrom
hiromieguchi802-lab:docs/useformcontext-useformstate-note
Open

docs: clarify useFormContext formState subscriptions#1197
hiromieguchi802-lab wants to merge 2 commits intoreact-hook-form:masterfrom
hiromieguchi802-lab:docs/useformcontext-useformstate-note

Conversation

@hiromieguchi802-lab
Copy link
Copy Markdown
Contributor

Summary

  • document that formState values accessed through useFormContext() inside a FormProvider tree do not establish subscriptions on their own
  • recommend useFormState when subscribing to values like errors, isDirty, and dirtyFields

Fixes #1193.

Testing

  • reviewed the updated docs copy in src/content/docs/useformcontext.mdx
  • verified the diff is limited to the useFormContext rules section

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 24, 2026

@hiromieguchi802-lab is attempting to deploy a commit to the BEEKAI OSS Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 24, 2026

Deploy Preview for sage-cassata-31d224 ready!

Name Link
🔨 Latest commit 77e1e16
🔍 Latest deploy log https://app.netlify.com/projects/sage-cassata-31d224/deploys/69c87ab2d64d42000775faa5
😎 Deploy Preview https://deploy-preview-1197--sage-cassata-31d224.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hiromieguchi802-lab
Copy link
Copy Markdown
Contributor Author

Quick follow-up: I pushed a small formatting fix for the useFormContext note in this PR. The remaining failing Run format code check is now reporting src/content/docs/useform.mdx, which is outside this PR's change set. The other blocking status still appears to be the fork-side Vercel authorization.

@hiromieguchi802-lab hiromieguchi802-lab force-pushed the docs/useformcontext-useformstate-note branch from bbcc80f to 9ac15f0 Compare March 27, 2026 08:54
@hiromieguchi802-lab
Copy link
Copy Markdown
Contributor Author

I pushed a cleanup update and rebased this branch onto the latest master.

This also removes an unrelated change that had slipped into useform.mdx, so the PR is now limited to the useFormContext note about using useFormState when subscription behavior is needed.

@hiromieguchi802-lab hiromieguchi802-lab force-pushed the docs/useformcontext-useformstate-note branch from 9ac15f0 to 77e1e16 Compare March 29, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useFormContext docs missing warning about stale formState and should recommend useFormState for subscriptions

1 participant