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
@@ -33,16 +33,15 @@ var {
} = ReactNative;
var UIExplorerButton = require('./UIExplorerButton');
var Tester = React.createClass({
current: 0,
getInitialState() {
return {
native: new Animated.Value(0),
js: new Animated.Value(0),
};
},
class Tester extends React.Component {
state = {
native: new Animated.Value(0),
js: new Animated.Value(0),
};
onPress() {
current = 0;
onPress = () => {
this.current = this.current ? 0 : 1;
const config = {
...this.props.config,
@@ -55,7 +54,7 @@ var Tester = React.createClass({
throw e;
}
Animated[this.props.type](this.state.js, { ...config, useNativeDriver: false }).start();
},
};
render() {
return (
@@ -76,8 +75,8 @@ var Tester = React.createClass({
</View>
</TouchableWithoutFeedback>
);
},
});
}
}
const styles = StyleSheet.create({
row: {