Skip to content

fix: make mode and reValidateMode reactive#12803

Merged
bluebill1049 merged 3 commits intoreact-hook-form:masterfrom
dusan233:fix/reactive-mode
May 11, 2025
Merged

fix: make mode and reValidateMode reactive#12803
bluebill1049 merged 3 commits intoreact-hook-form:masterfrom
dusan233:fix/reactive-mode

Conversation

@dusan233
Copy link
Copy Markdown
Contributor

@dusan233 dusan233 commented May 7, 2025

Moved validationModeBeforeSubmit and validationModeAfterSubmit into the onChange handler so that we re-compute both modes on every event trigger. This ensures the handler always respects the latest mode and reValidateMode settings instead of relying on stale, one-time values.

Related issue: #12797

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@dusan233 dusan233 changed the title fix: make mode and reValidateMode reactive #12797 fix: make mode and reValidateMode reactive May 7, 2025
@bluebill1049
Copy link
Copy Markdown
Member

could you include a unit test for this?

@dusan233
Copy link
Copy Markdown
Contributor Author

dusan233 commented May 7, 2025

Yes, will do

@bluebill1049 bluebill1049 merged commit 8e6dc9e into react-hook-form:master May 11, 2025
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