Skip to content

Commit 2a48d62

Browse files
committed
initial trigger fix
1 parent c5f1fc5 commit 2a48d62

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

lib/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,15 @@ var MtSvgLines = function (_React$Component) {
5656
_this._animStart = 0;
5757
};
5858

59-
var initClassKey = 'mt-' + (0, _utils.shortUID)();
60-
6159
_this.state = {
62-
classKey: initClassKey, // unique class name for the wrapper, an internal "trigger" (re-gen each time anim is to run)
60+
classKey: 'mt-' + (0, _utils.shortUID)(), // unique class name for the wrapper, an internal "trigger" (re-gen each time anim is to run)
6361
css: '', // generated CSS
6462
tweenElapsed: 0, // tween duration so far (ms)
6563
tweenProgress: 0 // tween completion (pct)
6664
};
6765

6866
_this._lastAnimate = '';
69-
_this._lastClassKey = initClassKey;
67+
_this._lastClassKey = '';
7068

7169
_this._animStart = 0; // anim start timestamp
7270

src/index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,17 @@ export default class MtSvgLines extends React.Component {
5555
constructor (props) {
5656
super(props)
5757

58-
const initClassKey = `mt-${shortUID()}`
59-
6058
this.state = {
61-
classKey: initClassKey, // unique class name for the wrapper, an internal "trigger" (re-gen each time anim is to run)
62-
css: '', // generated CSS
63-
tweenElapsed: 0, // tween duration so far (ms)
64-
tweenProgress: 0 // tween completion (pct)
59+
classKey: `mt-${shortUID()}`, // unique class name for the wrapper, an internal "trigger" (re-gen each time anim is to run)
60+
css: '', // generated CSS
61+
tweenElapsed: 0, // tween duration so far (ms)
62+
tweenProgress: 0 // tween completion (pct)
6563
}
6664

6765
this._lastAnimate = ''
68-
this._lastClassKey = initClassKey
66+
this._lastClassKey = ''
6967

70-
this._animStart = 0 // anim start timestamp
68+
this._animStart = 0 // anim start timestamp
7169

7270
this._pathElems = []
7371
this._pathDataFrom = {}

0 commit comments

Comments
 (0)