diff --git a/packages/wx-react/miniprogram_dist/index.js b/packages/wx-react/miniprogram_dist/index.js index ecd233f..80ee1a9 100644 --- a/packages/wx-react/miniprogram_dist/index.js +++ b/packages/wx-react/miniprogram_dist/index.js @@ -15,6 +15,7 @@ import tackleWithStyleObj from './tackleWithStyleObj' import styleType from './styleType' import instanceManager from './InstanceManager' import {getPropsMethod, getRootContext, rootUuid} from './util' +import {unstable_batchedUpdates} from './unstable' export default { @@ -33,7 +34,8 @@ export default { instanceManager, getPropsMethod, getRootContext, - rootUuid + rootUuid, + unstable_batchedUpdates } export { @@ -51,6 +53,7 @@ export { instanceManager, getPropsMethod, getRootContext, - rootUuid + rootUuid, + unstable_batchedUpdates } export const h = createElement \ No newline at end of file diff --git a/packages/wx-react/miniprogram_dist/unstable.js b/packages/wx-react/miniprogram_dist/unstable.js new file mode 100644 index 0000000..5a11837 --- /dev/null +++ b/packages/wx-react/miniprogram_dist/unstable.js @@ -0,0 +1,15 @@ +/** + * Copyright (c) Areslabs. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +import reactUpdate from './ReactUpdate' + +export function unstable_batchedUpdates(func) { + reactUpdate.setFlag(true) + func() + reactUpdate.setFlag(false) + reactUpdate.finalUpdate() +} \ No newline at end of file