React / Mobx - component redraws, but component WillReceiveProps () is not called

I have a React / Mobx app. When I make changes to the repository, the component updates (redraws), but I need to make some comparisons to add some additional functions, so I want to use componentWillReceiveProps (nextProps) and compare nextProps with this.props. Somehow it is not called. Any idea what I'm doing wrong, or what else can I do to get this?

+6
source share
1 answer

tl; dr: use componentWillUpdateandcomponentDidUpdate


Store, , , . @observable , . , , shouldComponentUpdate, componentWillReceiveProps componentDidReceiveProps, , . mobx shouldComponentUpdate.

, , componentWillUpdate componentDidUpdate.

+1

All Articles