Skip to content

Commit 5f65587

Browse files
committed
remove object.assign
1 parent 6d04712 commit 5f65587

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/QueueAnim.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ class QueueAnim extends React.Component {
254254
});
255255
}
256256

257-
getInitAnimType = (node, _data) => {
257+
getInitAnimType = (node, velocityConfig) => {
258258
/*
259259
* enterForcedRePlay 为 false 时:
260260
* 强行结束后,获取当前 dom 里是否有 data 里的 key 值,
261261
* 如果有,出场开始启动为 dom 里的值
262262
* 而不是 animTypes 里的初始值,如果是初始值将会跳动。
263263
*/
264-
const data = Object.assign({}, assignChild(_data));
264+
const data = { ...assignChild(velocityConfig) };
265265
const transformsBase = velocity &&
266266
velocity.prototype.constructor.CSS.Lists.transformsBase || [];
267267
const nodeStyle = node.style;

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function assignChild(data) {
9191
obj[key] = [].concat(data[key]);
9292
return;
9393
} else if (typeof data[key] === 'object') {
94-
obj[key] = Object.assign({}, data[key]);
94+
obj[key] = { ...data[key] };
9595
return;
9696
}
9797
obj[key] = data[key];

0 commit comments

Comments
 (0)