Fill in the signup form and watch each field's lifecycle — pristine, touched, dirty, validating, valid or invalid — plus the submit button's own gate logic. The username field runs an async “is this taken?” check against a simulated network; toggle network conditions below to see validation races and stale responses get handled (or not). No backend; everything below runs in your browser.
touched on blur and dirty once its value differs from the initial empty state
— tracked separately from validity so the UI can, say, only show an error after the user has
actually left the field. Validating is its own state for the async username check; a
response that arrives after a newer keystroke superseded it is discarded rather than applied, so a
slow “available” can’t overwrite a fresh “taken.” The submit button reads
overall form validity plus an in-flight submit flag — it isn’t just “are there any
errors on screen right now.”
Built by Pushpendra Mishra — React Native / React engineer. Vanilla JS, one file, theme-aware. Code reference: public-demos/form-state-management-demo · read the case study →