Javascript – Cannot read properties of undefined in react component
i have the following react component function App() { const [users, setUsers] = useState(test); const [name, setName] = useState(""); const [amount, setAmount] = useState(0); const [total, setTotal] = useState(0); const [usersNames, setUsersName] = useState([]) const addUser = () => {…