I have an event handler in ReactJS designed so that when someone clicks the \"Done\" checkbox for a calendar entry, the calendar entry is still in the system but it is marke
From the documentation (in a big red box nonetheless):
setState()does not immediately mutatethis.statebut creates a pending state transition. Accessingthis.stateafter calling this method can potentially return the existing value.
and
The second (optional) parameter is a callback function that will be executed once
setStateis completed and the component is re-rendered.
That callback gets passed the updated state afaik.