Skip to content

Commit

Permalink
chore: upgrade size-sensor version
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed May 19, 2020
1 parent f59d39f commit c457265
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

14 changes: 11 additions & 3 deletions demo/dist/bundle.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/core.js
Expand Up @@ -130,6 +130,11 @@ var EchartsReactCore = function (_Component) {
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
// 判断是否需要 setOption,由开发者自己来确定。默认为 true
if (typeof this.props.shouldSetOption === 'function' && !this.props.shouldSetOption(prevProps, this.props)) {
return;
}

// 以下属性修改的时候,需要 dispose 之后再新建
// 1. 切换 theme 的时候
// 2. 修改 opts 的时候
Expand All @@ -147,11 +152,6 @@ var EchartsReactCore = function (_Component) {
return;
}

// 判断是否需要 setOption,由开发者自己来确定。默认为 true
if (typeof this.props.shouldSetOption === 'function' && !this.props.shouldSetOption(prevProps, this.props)) {
return;
}

var echartObj = this.renderEchartDom();
// 样式修改的时候,可能会导致大小变化,所以触发一下 resize
if (!(0, _fastDeepEqual2['default'])(prevProps.style, this.props.style) || !(0, _fastDeepEqual2['default'])(prevProps.className, this.props.className)) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "echarts-for-react",
"version": "2.0.15-beta.1",
"version": "2.0.16",
"description": "baidu Echarts(v3.x & v4.x) components for react.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -88,7 +88,7 @@
},
"dependencies": {
"fast-deep-equal": "^2.0.1",
"size-sensor": "^0.2.0"
"size-sensor": "^1.0.0"
},
"peerDependencies": {
"react": ">=0.13.2 || ^0.14 || ^15.0.0 || >=16.0.0",
Expand Down

0 comments on commit c457265

Please sign in to comment.