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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c4e2-33eb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c4e2-33eb3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?