epicweb-dev / react-hooks

Learn React Hooks! 🎣 ⚛
https://hooks.epicreact.dev
Other
2.78k stars 1.91k forks source link

React 18 state batching #192

Closed ghost closed 2 years ago

ghost commented 2 years ago

i wouldn't expect it to be a huge problem it's cool thing that it might need small updated(or notification) so people can learn about state batching and how it works since React 18 rolled the case where state batching also work on async operations i think this is no longer an issue as i'v tried it on my actual workspace and it worked fine , or i might be the one missing something ?

Thank your for the effort creating such beautiful and well made course ,

AsyncBatching

kentcdodds commented 2 years ago

You're correct. It's noted in the instruction:

This is no longer the case in React 18 as it supports automatic batching for asynchronous callback too.

https://github.com/kentcdodds/react-hooks/blob/main/src/exercise/06.md#3--store-the-state-in-an-object

Thanks!