Skip to content

fix(useFieldArray): do not mark form dirty when array default is null - #13750

Merged
bluebill1049 merged 2 commits into
react-hook-form:masterfrom
soroush5:fix/field-array-null-default-dirty
Sep 17, 2026
Merged

bluebill1049 merged 2 commits into
react-hook-form:masterfrom
soroush5:fix/field-array-null-default-dirty

Conversation

@soroush5

Copy link
Copy Markdown
Contributor

Mounting useFieldArray over an array field whose default is null marked the form dirty immediately, so API-fed forms showed unsaved-changes state on load with zero user input. The mount guard now only initializes when the value is actually undefined.

Verified: new regression test fails before and passes after, field-array neighbors green.

Fixes #13749

@bluebill1049
bluebill1049 merged commit f61d666 into react-hook-form:master Sep 17, 2026
6 checks passed
@soroush5

Copy link
Copy Markdown
Contributor Author

Thanks for the review and merge.

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.

useFieldArray over a null default marks the form dirty on mount

2 participants