Skip to content

Commit ce88805

Browse files
committed
Remove duplicated logic
1 parent ee0aaf9 commit ce88805

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/hooks/useAnimations.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createRef, useEffect, useLayoutEffect, useRef, useState } from "react";
22
import {
33
getKeys,
4-
isArray,
54
isSameObject,
65
isSameObjectArray,
76
toArray,
@@ -58,7 +57,7 @@ export const useAnimations = <ID extends string>(
5857
const initAnimation = (name: ID): Animation => {
5958
const el = getTarget()!;
6059
const [kf, options] = getKeyframesAndOptions(name);
61-
const keyframes = isArray(kf) ? kf : [kf];
60+
const keyframes = toArray(kf);
6261
if (cache.has(name)) {
6362
const [prevAnimation, prevEl, prevKeyframes, prevOptions] =
6463
cache.get(name)!;

0 commit comments

Comments
 (0)