@@ -27111,6 +27111,10 @@ function easyCompHOC(WrappedComp) {
27111
27111
WrappedComp.defaultProps = renderer.defaultProps;
27112
27112
}
27113
27113
27114
+ if (typeof WrappedComp.prototype.shouldComponentUpdate === 'function') {
27115
+ throw new Error('Do not implement shouldComponentUpdate, easyState already optimizes it for you!');
27116
+ }
27117
+
27114
27118
return function (_WrappedComp) {
27115
27119
_inherits(EasyCompWrapper, _WrappedComp);
27116
27120
@@ -27147,11 +27151,7 @@ function easyCompHOC(WrappedComp) {
27147
27151
}
27148
27152
}, {
27149
27153
key: 'shouldComponentUpdate',
27150
- value: function shouldComponentUpdate(nextProps) {
27151
- if (_get(EasyCompWrapper.prototype.__proto__ || Object.getPrototypeOf(EasyCompWrapper.prototype), 'shouldComponentUpdate', this)) {
27152
- return _get(EasyCompWrapper.prototype.__proto__ || Object.getPrototypeOf(EasyCompWrapper.prototype), 'shouldComponentUpdate', this).call(this);
27153
- }
27154
-
27154
+ value: function shouldComponentUpdate(nextProps, nextState) {
27155
27155
var props = this.props;
27156
27156
27157
27157
var keys = Object.keys(props);
@@ -38893,8 +38893,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
38893
38893
38894
38894
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
38895
38895
38896
- var App = function (_Component ) {
38897
- _inherits(App, _Component );
38896
+ var App = function (_PureComponent ) {
38897
+ _inherits(App, _PureComponent );
38898
38898
38899
38899
function App() {
38900
38900
_classCallCheck(this, App);
@@ -38941,7 +38941,7 @@ var App = function (_Component) {
38941
38941
}]);
38942
38942
38943
38943
return App;
38944
- }(_react.Component );
38944
+ }(_react.PureComponent );
38945
38945
38946
38946
// wrap the component with easyComp before exporting it
38947
38947
0 commit comments