-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
formsStuff relating to forms and form actionsStuff relating to forms and form actionstypes / typescript
Description
Describe the problem
I think it would make sense to be able to set partial data on form.fields. For example with this form:
export const editData = form(
v.object({ name: v.string(), id: v.string(), confirmationName: v.string() }),
async (data) => {
// ...
}
);editData.fields.set({ name: "foo", id: "123" }) should then set name and id, and leave confirmationName alone. Today, TypeScript yells at me that confirmationName is missing.
Describe the proposed solution
form.fields.set should accept Partial<T> instead of T. Maybe also for nested fields, such as form.fields.my.nested.field.set?
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formsStuff relating to forms and form actionsStuff relating to forms and form actionstypes / typescript