🔬 test: add regression tests for #12837 and #13136#13187
Merged
bluebill1049 merged 3 commits intoreact-hook-form:masterfrom Dec 12, 2025
Merged
🔬 test: add regression tests for #12837 and #13136#13187bluebill1049 merged 3 commits intoreact-hook-form:masterfrom
bluebill1049 merged 3 commits intoreact-hook-form:masterfrom
Conversation
afe9b49 to
9f6366e
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds regression tests for two previously fixed issues to prevent future breakage. The tests document specific user scenarios that were causing problems.
Key Changes:
- Added test for
isDirtystate tracking withuseFieldArrayoperations after reset (#12837) - Added test to verify no React rendering errors occur when adding multiple fields with async validation (#13136)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/tests/useFieldArray.test.tsx | Adds test verifying isDirty correctly updates after reset when using fieldArray operations with useFormState subscription |
| src/tests/useForm/resolver.test.tsx | Adds test ensuring no "Cannot update component while rendering" errors occur when combining fieldArray, async validation, and reset operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f6366e to
8ab7349
Compare
8ab7349 to
1907169
Compare
bluebill1049
approved these changes
Dec 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add regression tests for #12837 and #13136
I saw these two issues were already fixed but didn't have specific tests covering the exact scenarios, so I added some to prevent regressions.
What's included
#12837 -
isDirtynot updating after reset withuseFieldArrayThe bug happened when using
useFormStatesubscription with fieldArray operations after a reset. Added test to cover this.#13136 - React warning when adding multiple fields with async validation
Race condition between validation and rendering caused "Cannot update component while rendering" errors. Test ensures this doesn't happen anymore.
Both issues were fixed in recent commits (particularly #13181), these tests just document the specific user scenarios and prevent them from breaking again.
Closes #12837
Closes #13136