@@ -27111,6 +27111,10 @@ function easyCompHOC(WrappedComp) {
2711127111 WrappedComp.defaultProps = renderer.defaultProps;
2711227112 }
2711327113
27114+ if (typeof WrappedComp.prototype.shouldComponentUpdate === 'function') {
27115+ throw new Error('Do not implement shouldComponentUpdate, easyState already optimizes it for you!');
27116+ }
27117+
2711427118 return function (_WrappedComp) {
2711527119 _inherits(EasyCompWrapper, _WrappedComp);
2711627120
@@ -27147,11 +27151,7 @@ function easyCompHOC(WrappedComp) {
2714727151 }
2714827152 }, {
2714927153 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) {
2715527155 var props = this.props;
2715627156
2715727157 var keys = Object.keys(props);
@@ -38893,8 +38893,8 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
3889338893
3889438894function _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; }
3889538895
38896- var App = function (_Component ) {
38897- _inherits(App, _Component );
38896+ var App = function (_PureComponent ) {
38897+ _inherits(App, _PureComponent );
3889838898
3889938899 function App() {
3890038900 _classCallCheck(this, App);
@@ -38941,7 +38941,7 @@ var App = function (_Component) {
3894138941 }]);
3894238942
3894338943 return App;
38944- }(_react.Component );
38944+ }(_react.PureComponent );
3894538945
3894638946// wrap the component with easyComp before exporting it
3894738947
0 commit comments