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
@@ -26,24 +26,20 @@ const {
const UIExplorerBlock = require('./UIExplorerBlock');
const UIExplorerPage = require('./UIExplorerPage');
const KeyboardAvoidingViewExample = React.createClass({
statics: {
title: '<KeyboardAvoidingView>',
description: 'Base component for views that automatically adjust their height or position to move out of the way of the keyboard.',
},
class KeyboardAvoidingViewExample extends React.Component {
static title = '<KeyboardAvoidingView>';
static description = 'Base component for views that automatically adjust their height or position to move out of the way of the keyboard.';
getInitialState() {
return {
behavior: 'padding',
modalOpen: false,
};
},
state = {
behavior: 'padding',
modalOpen: false,
};
onSegmentChange(segment: String) {
onSegmentChange = (segment: String) => {
this.setState({behavior: segment.toLowerCase()});
},
};
renderExample() {
renderExample = () => {
return (
<View style={styles.outerContainer}>
<Modal animationType="fade" visible={this.state.modalOpen}>
@@ -69,7 +65,7 @@ const KeyboardAvoidingViewExample = React.createClass({
</TouchableHighlight>
</View>
);
},
};
render() {
return (
@@ -79,8 +75,8 @@ const KeyboardAvoidingViewExample = React.createClass({
</UIExplorerBlock>
</UIExplorerPage>
);
},
});
}
}
const styles = StyleSheet.create({
outerContainer: {