Skip to content
Source
Sign inSign up
TanStack/form

Rename Validators to Avoid DOM Event Confusion #491

Send to my agent
Closedcrutchcorn(GitHub profile, opens in a new tab) opened this issue 2 comments

In my time showcasing TanStack Form, I noticed a lot of confusion around <Field>'s onChange validator comparing to onChange from the <input> HTML event.

Let's solve this by renaming:

<form.Field onChange={z.string()}/>

To:

<form.Field validators={{onChange: z.string()}}/>

This ticket should also include:

  • Renaming the validators to validators prefix property
  • Changing mount validator API to match the others (prev: #429)
  • Adding onSubmit and onSubmitAsync to FormAPI
  1. crutchcorn(GitHub profile, opens in a new tab) added labelshelp wanted

  2. Also in favor of option 2.

Sign in to join this conversation.