DEV Community

Discussion on: What's Automatic Batching? React 18 feature explained

Collapse
 
phatnguyenuit profile image
Fast Nguyen

Good explanation about React 18 auto batching!
Anyway, I think it would be better if you can update setState examples by using callbacks instead of referencing the current state value directly

setCountOne(countOne => countOne + 1);
Enter fullscreen mode Exit fullscreen mode

Thank you,

Collapse
 
danstanhope profile image
Dan Stanhope

Thanks very much! Great suggestion, I've updated the article. Appreciate it & all the best.

Collapse
 
phatnguyenuit profile image
Fast Nguyen

very nice 😍!