File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff 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 ( )
Original file line number Diff line number Diff 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 ( )
You can’t perform that action at this time.
0 commit comments