Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/addons/ReactComponentWithPureRenderMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ var shallowCompare = require('shallowCompare');
* use `forceUpdate()` when you know deep data structures have changed.
*/
var ReactComponentWithPureRenderMixin = {
shouldComponentUpdate: function(nextProps, nextState) {
return shallowCompare(this, nextProps, nextState);
shouldComponentUpdate: function(nextProps, nextState, nextContext) {
return shallowCompare(this, nextProps, nextState, nextContext);
},
};

Expand Down
5 changes: 3 additions & 2 deletions src/addons/shallowCompare.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ var shallowEqual = require('shallowEqual');
* Does a shallow comparison for props and state.
* See ReactComponentWithPureRenderMixin
*/
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)
);
}

Expand Down