Skip to content

Commit

Permalink
fix(wx-react): 修复嵌套unstable_batchedUpdates 多次渲染的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ykforerlang committed Jul 2, 2019
1 parent fd559ed commit dfbac12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/wx-react/miniprogram_dist/unstable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import reactUpdate from './ReactUpdate'

export function unstable_batchedUpdates(func) {
if (reactUpdate.inRe()) {
func()
return
}

reactUpdate.setFlag(true)
func()
reactUpdate.setFlag(false)
Expand Down

0 comments on commit dfbac12

Please sign in to comment.