-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
If you try to update an array, onSubmit function confuses the parameter and replaces all the elements with the newest value.
Steps to reproduce
Initiate a form and use the onSubmit function to update an array like this:
let newMembers = [];
const { form, handleSubmit } = createForm({
initialValues: {
name: "",
members: []
},
onSubmit: newUser => {
newMembers.push(newUser)
}
});
What is the current bug behavior?
onSubmit function uses the new parameter and replaces all the elements with the new one.
What is the expected correct behavior?
The function should add the element to the end of the array instead of updating all the elements
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working