TanStack / form

🤖 Powerful and type-safe form state management for the web. TS/JS, React Form, Solid Form, Lit Form and Vue Form.
https://tanstack.com/form
MIT License
3.74k stars 338 forks source link

Rename Validators to Avoid DOM Event Confusion #491

Closed crutchcorn closed 10 months ago

crutchcorn commented 1 year ago

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:

aadito123 commented 12 months ago

Also prefer the 2nd.

natedunn commented 12 months ago

Also in favor of option 2.