Description
Kind of related #2073
It seems to me there's a natural correlation between mount and update methods:
getInitialState => componentWillReceiveProps
(always true) => shouldComponentUpdate
componentWillMount => componentWillUpdate
componentDidMount => componentDidUpdate
In many situations you want to have the same code for mount/update, but you have to put it in a shared method and call it from both places. It's hardly common enough that it's an issue, but it seems common enough that it strikes me as a bit odd... perhaps. Just an idea, could it make sense to e.g. get rid of mount altogether and instead have the following (it's extreme perhaps, but just as an example):
// mounting
getInitialState
componentWillReceiveProps(update = false?)
componentWillUpdate(update = false)
componentDidUpdate(update = false)
// updating
componentWillReceiveProps(update = true?)
shouldComponentUpdate
componentWillUpdate(update = true)
componentDidUpdate(update = true)
It would unify the life-cycle and move away from mounting being treated as entirely separate from updating, it would then be seen as an exception. There would be less potential for inconsistencies causes by mistake/neglect.
I haven't thought this through extensively and bring it up mainly to start a discussion, I know many others have wondered why there isn't a life-cycle method for mount+update.