Revert "Update shallowCompare to accept nextContext" (#6877)
Ben Alpert committed
May 25, 2016 at 14:37 UTC
eb050727ee691702ac6a489c378582bff34acd9e
2 files changed
+4
-5
src/addons/ReactComponentWithPureRenderMixin.js
+2
-2
@@ -40,8 +40,8 @@ var shallowCompare = require('shallowCompare');
40
* See https://facebook.github.io/react/docs/pure-render-mixin.html
41
*/
42
var ReactComponentWithPureRenderMixin = {
43
- shouldComponentUpdate: function(nextProps, nextState, nextContext) {
44
- return shallowCompare(this, nextProps, nextState, nextContext);
43
+ shouldComponentUpdate: function(nextProps, nextState) {
44
+ return shallowCompare(this, nextProps, nextState);
45
},
46
};
47
src/addons/shallowCompare.js
+2
-3
@@ -18,11 +18,10 @@ var shallowEqual = require('shallowEqual');
18
* See ReactComponentWithPureRenderMixin
19
* See also https://facebook.github.io/react/docs/shallow-compare.html
20
*/
21
-function shallowCompare(instance, nextProps, nextState, nextContext) {
21
+function shallowCompare(instance, nextProps, nextState) {
22
return (
23
!shallowEqual(instance.props, nextProps) ||
24
- !shallowEqual(instance.state, nextState) ||
25
- !shallowEqual(instance.context, nextContext)
24
+ !shallowEqual(instance.state, nextState)
25
);
26
}
27