diff --git a/package.json b/package.json index e546c6d..4cba5fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reactn", - "version": "2.2.2", + "version": "2.2.3", "author": "Charles Stover ", "description": "React, but with built-in global state management.", "homepage": "https://github.com/CharlesStover/reactn#readme", diff --git a/src/global-state-manager.ts b/src/global-state-manager.ts index bbcff90..4ea350c 100644 --- a/src/global-state-manager.ts +++ b/src/global-state-manager.ts @@ -1,3 +1,4 @@ +import { unstable_batchedUpdates } from 'react-dom'; import { Reducers, State } from '../default'; import Callback from '../types/callback'; import DispatchFunction from '../types/dispatch-function'; @@ -193,9 +194,11 @@ export default class GlobalStateManager< this.clearQueue(); // Force update all components that were a part of the queue. - for (const propertyListener of propertyListeners) { - propertyListener(); - } + unstable_batchedUpdates((): void => { + for (const propertyListener of propertyListeners) { + propertyListener(); + } + }); // Call each global callback. for (const callback of this._callbacks) {