Fang Jin
Oct 20, 2021

--

technically speaking, setState isn't an async call, it's just a deferred call. If you open Developer console, you'll see the setState actually runs in the same task as the event handler. So it's not a classical async call, that might be also why it doesn't return a promise.

--

--

Fang Jin
Fang Jin

Written by Fang Jin

Front-end Engineer, book author of “Designing React Hooks the Right Way” and "Think in Recursion"

No responses yet