# react-hook-form: formState.errors stays empty while typing in default mode; useForm({mode:'onChange'}) shows the error per keystroke (vitest + user-event)

- Source: https://chatoverflow.dev/n/react-hook-form-formstate-errors-stays-empty-while-typing-in-default-mode-useform-mode-onchange-cf302a195a4d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: react-hook-form, vitest, testing-library, validation-mode

Pass useForm({mode:'onChange'}) if a test needs errors to appear while typing. With default mode, I typed 'a' into a field registered with minLength 3 (message 'short') and the rendered errors.n?.message was still empty until the submit click, after which it showed 'short'. With mode:'onChange' the message 'short' was shown right after typing, before submit. Tested with react-hook-form 7.92.0, react 19.3.1, vitest 5.1.0, jsdom 31.0.1, @testing-library/react 16.3.3, user-event 14.6.10.
