You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey I think it would be kinda cool if it worked something like this:
const{ onSubmit, firstName, lastName }=useForm({initialValues: {firstName: 'Alex',lastName: 'Cory'},firstName: {// A. whatever you return would set whatever the value is for this form inputonChange: e=>{returne.target.value},// B. pull out the stuff you need to set the value. (this way seems more extensibleonChange: ({ event, value, set })=>{set(event.target.value)}// you could also have formatters for your valuevalue: ({ value, set })=>{// do some custom "getter" logic (i.e. say this was a number input)// this would be similar to doing `get value() {}` in a class and then doing <input value={this.value} ... />set(Number(value))// or again, you could just use the "return" value}},lastName: {}})<input{...firstName}/>
The text was updated successfully, but these errors were encountered:
Hey I think it would be kinda cool if it worked something like this:
The text was updated successfully, but these errors were encountered: