diff --git a/src/addons/ReactComponentWithPureRenderMixin.js b/src/addons/ReactComponentWithPureRenderMixin.js index cf00d7cb3d..3354185257 100644 --- a/src/addons/ReactComponentWithPureRenderMixin.js +++ b/src/addons/ReactComponentWithPureRenderMixin.js @@ -40,8 +40,8 @@ var shallowCompare = require('shallowCompare'); * See https://facebook.github.io/react/docs/pure-render-mixin.html */ var ReactComponentWithPureRenderMixin = { - shouldComponentUpdate: function(nextProps, nextState) { - return shallowCompare(this, nextProps, nextState); + shouldComponentUpdate: function(nextProps, nextState, nextContext) { + return shallowCompare(this, nextProps, nextState, nextContext); }, }; diff --git a/src/addons/shallowCompare.js b/src/addons/shallowCompare.js index a6b7a1095d..4e25aa7654 100644 --- a/src/addons/shallowCompare.js +++ b/src/addons/shallowCompare.js @@ -18,10 +18,11 @@ var shallowEqual = require('shallowEqual'); * See ReactComponentWithPureRenderMixin * See also https://facebook.github.io/react/docs/shallow-compare.html */ -function shallowCompare(instance, nextProps, nextState) { +function shallowCompare(instance, nextProps, nextState, nextContext) { return ( !shallowEqual(instance.props, nextProps) || - !shallowEqual(instance.state, nextState) + !shallowEqual(instance.state, nextState) || + !shallowEqual(instance.context, nextContext) ); }