# this.setStat() Asynchronous or Synchronous

**URL:** <https://forum.codewithmosh.com/t/this-setstat-asynchronous-or-synchronous/9546>\
**Category:** React\
**Created:** [December 30, 2021, 8:26pm UTC](https://forum.codewithmosh.com/t/this-setstat-asynchronous-or-synchronous/9546 "2021-12-30T20:26:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![A100D-JS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/a100d-js/32/8_2.png) [@A100D-JS](https://forum.codewithmosh.com/u/A100D-JS)\
**Post date:** [December 31, 2021, 11:49am UTC](https://forum.codewithmosh.com/t/this-setstat-asynchronous-or-synchronous/9546/2 "2021-12-31T11:49:35Z")

</div>

Hi,

 ![This SetState](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/0/0fbd335e1501ae6ff027510f25006faec0444c1e.png)

[javascript - Why is setState in reactjs Async instead of Sync? - Stack Overflow](https://stackoverflow.com/questions/36085726/why-is-setstate-in-reactjs-async-instead-of-sync#:~:text=Yes%2C%20setState()%20is%20asynchronous.&text=React%20does%20not%20guarantee%20that,always%20immediately%20update%20the%20component).

This short article might also be helpful:

> **[Why Is setState() Asynchronous In React?](https://javascript.plainenglish.io/why-is-setstate-asynchronous-in-react-63827033ff45)**
>
> Or Is It Synchronous?

 ![SetState Asynchronous](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/b/b9463213696b1c23b06dd2ce2dc732f7aebb552f.png)

Also take a look at this topic:

> [@10- Removing the Local State](https://forum.codewithmosh.com/t/10-removing-the-local-state/666/4):
>
> […,this.state.counters] copy the state, you can do whatever you want to do without any side-effects. This is the concept of Functional Programming. You will be confused about the setState will eventually change the state, so why bothered. Actually is not.The React is kind of state machine. setState will package states in to queue waiting to deal with. They are isolated with each other. If you Change the state directly.There are many other places use the state will be changed. And al…

---

_[View the full topic](https://forum.codewithmosh.com/t/this-setstat-asynchronous-or-synchronous/9546)._
