Last active
May 10, 2018 23:03
-
-
Save jabbawookiees/a7ca9e3a5264ea331caf1da098ccd706 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 from 'react'; | |
import { Animated, Easing, Text } from 'react-native'; | |
class AnimatedComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.animation = new Animated.Value(0.001); | |
} | |
componentDidMount() { | |
this.animation.setValue(0.001); | |
Animated.timing(this.animation, {toValue: 1, duration: 1000, easing: Easing.linear}).start(); | |
} | |
render() { | |
return ( | |
<Animated.View style={{opacity: this.animation}}> | |
<Text>Hello world</Text> | |
</Animated.View> | |
); | |
} | |
} | |
export default AnimatedComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment