React cant reach current state

mertyjsx

mertyjsx

Posted on October 28, 2020

React cant reach current state

https://codesandbox.io/s/the-appropriate-use-of-usecallback-forked-o55n6?file=/src/Example.js:248-400
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)

💖 💪 🙅 🚩
mertyjsx
mertyjsx

Posted on October 28, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Thread of React Native projects
react Thread of React Native projects

December 4, 2020

React cant reach current state
react React cant reach current state

October 28, 2020