Created
June 13, 2021 15:59
-
-
Save sadam1807/82240b828868fa85426f52c6d5fda6ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nnnbbnnbnb