Hello,
thanks for your awesome work on mobx-react!
I observe a behavior that I could not find documented and looks like a bug: when calling an action asynchronously from a componentWillMount hook, the react component will not rerender, when calling the action from an componentDidMount hook, it will.
Failing example with componentWillMount
import { action, observable } from 'mobx'
import { observer } from 'mobx-react'
import * as React from 'react'
@observer
export class WillMount extends React.Component<{}, {}> {
@observable counter = 0
@action inc = () => this.counter++
componentWillMount = () => {
setTimeout(() => this.inc(), 3000)
}
render() {
return <p>{this.counter}<button onClick={this.inc}>+</button></p>
}
}
As the following console output shows, this.inc() is triggered, and this.counter is updated correctly, yet no rerender is scheduled:

Strangely, calling the action manually by clicking the button does also not trigger a rerender:

Working example with componentDidMount
import { action, observable } from 'mobx'
import { observer } from 'mobx-react'
import * as React from 'react'
@observer
export class DidMount extends React.Component<{}, {}> {
@observable counter = 0
@action inc = () => this.counter++
componentDidMount = () => {
setTimeout(() => this.inc(), 3000)
}
render() {
return <p>{this.counter}<button onClick={this.inc}>+</button></p>
}
}
This works as expected, here is the console.log:

Also clicking the button works now, see:

Questions
Is this expected behaviour? If yes, can we enhance the documentation?