React.useEffect(
() => {
const users = [
{id:123123123,
name:"mert",
del: <deleteButton onClick={()=>console.log(users)} />
}]
setusers(users)
}, [])
hello i have a problem I created a useState called [users, setusers] and in useeffect, I have assigned a delete function for each user. this delete function needs to reach users state
But the problem starts here. When I want to reach users through the delete function, I get the initial state of the state, (the state at the time I created the first user object)