diff --git a/package.json b/package.json index 74d4223d..95b1a313 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-stickynode", - "version": "2.1.0", + "version": "2.1.1", "description": "A performant and comprehensive React sticky", "main": "index.js", "scripts": { @@ -32,7 +32,7 @@ "dependencies": { "classnames": "^2.0.0", "prop-types": "^15.6.0", - "react-addons-shallow-compare": "^0.14.2 || ^15.0.0", + "shallowequal": "^1.0.0", "subscribe-ui-event": "^2.0.0" }, "devDependencies": { diff --git a/src/Sticky.jsx b/src/Sticky.jsx index fe7e494e..520e0217 100644 --- a/src/Sticky.jsx +++ b/src/Sticky.jsx @@ -11,7 +11,7 @@ import PropTypes from 'prop-types' import {subscribe} from 'subscribe-ui-event'; import classNames from 'classnames'; -import shallowCompare from 'react-addons-shallow-compare'; +import shallowEqual from 'shallowequal'; // constants const STATUS_ORIGINAL = 0; // The default status, locating at the original position. @@ -356,7 +356,7 @@ class Sticky extends Component { } shouldComponentUpdate (nextProps, nextState) { - return !this.props.shouldFreeze() && shallowCompare(this, nextProps, nextState); + return !this.props.shouldFreeze() && !(shallowEqual(this.props, nextProps) && shallowEqual(this.state, nextState)); } render () {