Javascript – React: Why does the value of my input not update, but outputting the same same state to the page or console does?
Here is my code: import { useState } from "react"; const Testing = () => { const [testa, setTesta] = useState({ Nickname: "Testing" }); return ( <> <button type="button" onClick={(e) => setTesta({})}>Add</button> <input type="text" value={testa?.Nickname} onChange={e => setTesta({ Nickname: e.target.value…