React cant reach current state
mertyjsx
Posted on October 28, 2020
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
Posted on October 28, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.