Created
October 30, 2017 22:33
-
-
Save biyootiful/b4a4ace253773b970f5f49c5511a9684 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
class FadeIn extends Component { | |
state = { | |
fadeAnim: new Animated.Value(0) | |
}; | |
componentDidMount() { | |
Animated.timing(this.state.fadeAnim, { | |
toValue: 1, | |
duration: 2500 | |
}).start(); | |
} | |
render() { | |
let { fadeAnim } = this.state; | |
return ( | |
<Animated.View | |
style={{ | |
...this.props.sytle, | |
opacity: fadeAnim | |
}} | |
> | |
{this.props.children} | |
</Animated.View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment