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

> I found myself just the other day wishing i could await the setting of a state variable, it was making saving a file in a complicated form a little difficult.

It used to be that React.setState would accept a callback function to fire after the state was set.

The newer setter function returned by useState doesn't have that anymore I'm pretty sure. Tbh I've never tried though.



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

Search: