2 ms·
This does not work. setMyState() is asynchronous. doSomething() would run, but not necessarily with the updated value of the state.
by mstudio 6y ago
This does not work. setMyState() is asynchronous. doSomething() would run, but not necessarily with the updated value of the state.
- schwartzworld 6y agoThen make the wrapper function async and await setMyState?