score:0

Accepted answer
const [cred,setCred] = useState(usersAccount)

const registerUser = (event) => {
  event.preventDefault();

  var { uname, pass } = document.forms[0];
  const username = uname.value;
  const password = pass.value;
  const newUserPass = {username, password}
  setCred([...newUserPass])
};

Related Query

More Query from same tag