Skip to content

Commit f24c2e4

Browse files
committed
chore: address feedback
1 parent bd73312 commit f24c2e4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/elements/Skeleton/Skeleton.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ export const Skeleton: FC<{ children: ReactNode }> = ({ children }) => {
1919
const animationRef = useRef<Animated.CompositeAnimation | null>(null)
2020

2121
useEffect(() => {
22-
const loop = Animated.loop(
22+
animationRef.current = Animated.loop(
2323
Animated.timing(opacity.current, {
2424
toValue: 1,
2525
duration: 1000,
2626
useNativeDriver: true,
2727
})
2828
)
29-
animationRef.current = loop
3029

31-
loop.start()
30+
animationRef.current.start()
3231

3332
return () => {
3433
animationRef.current.stop()

src/elements/Spinner/Spinner.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const Spinner: React.FC<SpinnerProps> = ({
6161
const animationRef = useRef<Animated.CompositeAnimation | null>(null)
6262

6363
useEffect(() => {
64-
const loop = Animated.loop(
64+
animationRef.current = Animated.loop(
6565
Animated.timing(rotation, {
6666
toValue: 1,
6767
duration: 1000,
@@ -73,9 +73,7 @@ export const Spinner: React.FC<SpinnerProps> = ({
7373
}
7474
)
7575

76-
animationRef.current = loop
77-
78-
loop.start()
76+
animationRef.current.start()
7977

8078
return () => {
8179
animationRef.current.stop()

0 commit comments

Comments
 (0)