Skip to content

fix(handleSubmit): ignore stale resolver result after reset - #13733

Merged
bluebill1049 merged 1 commit into
react-hook-form:masterfrom
soroush5:fix/handlesubmit-stale-resolver-after-reset
Sep 11, 2026
Merged

bluebill1049 merged 1 commit into
react-hook-form:masterfrom
soroush5:fix/handlesubmit-stale-resolver-after-reset

Conversation

@soroush5

Copy link
Copy Markdown
Contributor

With an async resolver, if reset() runs while a submit is waiting on the resolver, the stale result was still applied: old errors written back into form state and onValid called with values from before the reset.

This guards the resolver branch in handleSubmit with the same reset check trigger() already uses, so a mid-submit reset wins and the stale submission is dropped.

@bluebill1049
bluebill1049 merged commit 3756191 into react-hook-form:master Sep 11, 2026
6 checks passed
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.

2 participants