Last active
July 1, 2020 16:39
-
-
Save fernandatoledo/8fc5a6b7270cbd569a924222bb2bb045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect, useRef} from 'react'; | |
import {View, Animated} from 'react-native'; | |
const AnimatedView = () => { | |
const animatedOpacity = useRef(new Animated.Value(0)).current; | |
useEffect(() => { | |
Animated.timing(animatedOpacity, { | |
toValue: 1, | |
duration: 1000, | |
}).start(); | |
}, []); | |
return ( | |
<Animated.View | |
style={{ | |
height: 100, | |
widht: 100, | |
opacity: animatedOpacity, | |
backgroundColor: 'yellow', | |
}} | |
/> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment