Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No. I'm using a callback in the setter which gives me the latest i and the setter never changes. If instead I would use setI(i+1) I'd have to add i as a dependency, but since state updates happen asynchronous, this would have a bug when calling it multiple times before the state is flushed.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: