Skip to content

Instantly share code, notes, and snippets.

@jabbawookiees
Last active May 10, 2018 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabbawookiees/a7ca9e3a5264ea331caf1da098ccd706 to your computer and use it in GitHub Desktop.
Save jabbawookiees/a7ca9e3a5264ea331caf1da098ccd706 to your computer and use it in GitHub Desktop.
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