fix: watch() returning undefined immediately after reset() - Issue #13088#13091
Merged
bluebill1049 merged 3 commits intoreact-hook-form:masterfrom Oct 10, 2025
Merged
Conversation
Comment on lines
-1413
to
-1416
| _state.mount = | ||
| !_proxyFormState.isValid || | ||
| !!keepStateOptions.keepIsValid || | ||
| !!keepStateOptions.keepDirtyValues; |
Member
There was a problem hiding this comment.
This would probably lead to some regression on user don't want to run
- update dirty values
- valid state
Contributor
Author
There was a problem hiding this comment.
I've addressed your feedback and made the changes. Could you please take a look?
The fix now preserves the original 3 conditional mount checks and adds an additional condition specifically for the reset
73e78c8 to
d20003e
Compare
hasnainDevX
pushed a commit
to hasnainDevX/react-hook-form
that referenced
this pull request
Oct 12, 2025
…eact-hook-form#13088 (react-hook-form#13091) * fix: watch() returning undefined immediately after reset() - Issue react-hook-form#13088 * fix: restore _state.mount assignment in createFormControl function --------- Co-authored-by: Bill <bluebill1049@hotmail.com>
6 tasks
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.
Set _state.mount to true in _reset function to ensure watch() returns the correct value immediately after reset() is called.
Previously, when reset() was called without any prior field interaction, _state.mount remained false, causing _getWatch to return _defaultValues instead of the updated _formValues.
Fixes #13088