diff --git a/package.json b/package.json index 4beed62..4ce2e22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-progress", - "version": "2.0.3", + "version": "2.0.4", "description": "progress ui component for react", "keywords": [ "react", diff --git a/src/Line.jsx b/src/Line.jsx index f049905..a761a1b 100644 --- a/src/Line.jsx +++ b/src/Line.jsx @@ -45,7 +45,7 @@ export default React.createClass({ stroke={strokeColor} strokeWidth={strokeWidth} fillOpacity="0" - ref="path" + ref={(path) => { this.path = path; }} style={pathStyle} /> diff --git a/src/mixin.js b/src/mixin.js index a66c465..8829434 100644 --- a/src/mixin.js +++ b/src/mixin.js @@ -24,9 +24,9 @@ export default { }, componentDidUpdate() { const now = Date.now(); - this.refs.path.style.transitionDuration = '0.3s, 0.3s'; + this.path.style.transitionDuration = '0.3s, 0.3s'; if (this.prevTimeStamp && now - this.prevTimeStamp < 100) { - this.refs.path.style.transitionDuration = '0s, 0s'; + this.path.style.transitionDuration = '0s, 0s'; } this.prevTimeStamp = Date.now(); },