Closed shadowvzs closed 4 years ago
Not sure if you figured it out, in didact setState only accepts a function as the parameter. So, you shouldn't use setState(newState)
but setState(oldState => newState)
.
Not sure if you figured it out, in didact setState only accepts a function as the parameter. So, you shouldn't use
setState(newState)
butsetState(oldState => newState)
.
@pomber
1. Issue with setTimeout
2. Issue with setTimeout
same code just with directly called element
use state not work if i call it from set timeout / interval