Convert from React.createClass to ES6 classes

Reviewed By: cpojer

Differential Revision: D3619143

fbshipit-source-id: e14e81468d467437ee3d79c34c34b7780a46ca1c
This commit is contained in:
Ben Alpert
2016-07-26 01:13:31 -07:00
committed by Facebook Github Bot 8
parent 857d2b8eae
commit a2fb703bbb
133 changed files with 2124 additions and 2191 deletions
+8 -10
View File
@@ -30,24 +30,22 @@ var {
View,
} = ReactNative;
var Flip = React.createClass({
getInitialState() {
return {
theta: new Animated.Value(45),
};
},
class Flip extends React.Component {
state = {
theta: new Animated.Value(45),
};
componentDidMount() {
this._animate();
},
}
_animate() {
_animate = () => {
this.state.theta.setValue(0);
Animated.timing(this.state.theta, {
toValue: 360,
duration: 5000,
}).start(this._animate);
},
};
render() {
return (
@@ -83,7 +81,7 @@ var Flip = React.createClass({
</View>
);
}
});
}
var styles = StyleSheet.create({
container: {