Skip to content

Instantly share code, notes, and snippets.

@sadam1807
Created June 13, 2021 15:59
Show Gist options
  • Save sadam1807/82240b828868fa85426f52c6d5fda6ea to your computer and use it in GitHub Desktop.
Save sadam1807/82240b828868fa85426f52c6d5fda6ea to your computer and use it in GitHub Desktop.
let handleChange = (i, e) => {
let newFormValues = [...formValues];
newFormValues[i][e.target.name] = e.target.value;
setFormValues(newFormValues);
}
let addFormFields = () => {
setFormValues([...formValues, { name: "", email: "" }])
}
let removeFormFields = (i) => {
let newFormValues = [...formValues];
newFormValues.splice(i, 1);
setFormValues(newFormValues)
}
@MohsinkaramatAli
Copy link

nnnbbnnbnb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment