How do I ensure that an action is performed after the view is updated in mobx?

The setState ({}, () = > {.}) function in

react, and the second parameter callback function executes

after the view is refreshed.

clipboard.png

but when using mobx, as shown above, how does this.commentsNum--, ensure that console? is executed after the view is refreshed? In the way the image is written, it is very likely that console.log () has been executed first and the view has not been updated yet.

Mar.25,2021

componentDidUpdate

Menu