Created
May 31, 2020 19:45
-
-
Save trblackw/0c668aceaf5d87ab36c0a6fd30977fc3 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
const initialFormState = { | |
email: "", | |
password: "", | |
valid: false, | |
} | |
function Form() { | |
const [form, setForm] = useState(initialFormState) | |
//when updating the password field | |
setForm(prevState => ({ ...prevState, password: "password123" })) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment