These are my notes on how you can update the value of a useState variable form a react form when there is a change on the form to update the value of the useState by using an object and updating the value from the form field.


const [register, setRegister] = useState({
    name: '',
    email: '',
    password: ''
});

const handleInput = (e) =>{
    e. presists();
    setRegister({...registerInput, [e.target.name]: e.target.value });
}

u7pe7XTF_es