Closed ecumene closed 3 years ago
user information is now in useState:
const [userInformation, setUserInformation] = useState({
username: "",
password: "",
});
onChange functions now use setUserInformation:
const onChangeName = (event) => {
setUserInformation((prevState) => ({
username: event.target.value,
password: prevState.password,
}));
};
const onChangePassword = (event) => {
setUserInformation((prevState) => ({
username: prevState.username,
password: event.target.value,
}));
};