-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the Bug
Our docs state that the useFormFields hook 'will only re-render when that field's state changes', but currently any change to any field in the form triggers a re-render.
Link to the code that reproduces this issue
https://github.com/payloadcms/payload/tree/fix/use-field-rerendering
Reproduction Steps
- checkout branch
fix/use-field-rerendering - run
_communitytest suite - go to
posts - open console to see logs
- type into the non-custom field
titleand expect the console log not to fire
You can then go to the file test/_community/components/CustomTextFieldClient, comment out the useFormFields() and uncomment the useField() to test this hook, repeat the steps above and see it fires when any field changes instead of the just the requested field.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Binaries:
Node: 23.11.0
npm: 10.9.2
Yarn: N/A
pnpm: 9.7.1
Relevant Packages:
payload: 3.59.1
@payloadcms/payload-cloud: 3.59.1
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 10
timothylp