mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 13:03:08 +08:00
Convert from React.createClass to ES6 classes
Reviewed By: cpojer Differential Revision: D3619143 fbshipit-source-id: e14e81468d467437ee3d79c34c34b7780a46ca1c
This commit is contained in:
committed by
Facebook Github Bot 8
parent
857d2b8eae
commit
a2fb703bbb
@@ -30,23 +30,28 @@ var {
|
||||
TouchableHighlight,
|
||||
} = ReactNative;
|
||||
|
||||
var UIExplorerButton = React.createClass({
|
||||
propTypes: {
|
||||
class UIExplorerButton extends React.Component {
|
||||
props: {onPress?: Function};
|
||||
|
||||
static propTypes = {
|
||||
onPress: React.PropTypes.func,
|
||||
},
|
||||
render: function() {
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<TouchableHighlight
|
||||
onPress={this.props.onPress}
|
||||
style={styles.button}
|
||||
underlayColor="grey">
|
||||
<Text>
|
||||
{this.props.children}
|
||||
{
|
||||
// $FlowFixMe found when converting React.createClass to ES6
|
||||
this.props.children}
|
||||
</Text>
|
||||
</TouchableHighlight>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
button: {
|
||||
|
||||
Reference in New Issue
Block a user