mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00: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
@@ -17,31 +17,35 @@ var StyleSheet = require('StyleSheet');
|
||||
var TouchEventUtils = require('fbjs/lib/TouchEventUtils');
|
||||
var View = require('View');
|
||||
|
||||
var TouchTestApp = React.createClass({
|
||||
handleStartShouldSetResponder: function(e) {
|
||||
class TouchTestApp extends React.Component {
|
||||
handleStartShouldSetResponder = (e) => {
|
||||
return true;
|
||||
},
|
||||
handleOnResponderMove: function(e) {
|
||||
};
|
||||
|
||||
handleOnResponderMove = (e) => {
|
||||
e = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
||||
Recording.record('move;' + e.touches.length);
|
||||
},
|
||||
handleResponderStart: function(e) {
|
||||
};
|
||||
|
||||
handleResponderStart = (e) => {
|
||||
e = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
||||
if (e.touches) {
|
||||
Recording.record('start;' + e.touches.length);
|
||||
} else {
|
||||
Recording.record('start;ExtraPointer');
|
||||
}
|
||||
},
|
||||
handleResponderEnd: function(e) {
|
||||
};
|
||||
|
||||
handleResponderEnd = (e) => {
|
||||
e = TouchEventUtils.extractSingleTouch(e.nativeEvent);
|
||||
if (e.touches) {
|
||||
Recording.record('end;' + e.touches.length);
|
||||
} else {
|
||||
Recording.record('end;ExtraPointer');
|
||||
}
|
||||
},
|
||||
render: function() {
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View
|
||||
style={styles.container}
|
||||
@@ -52,8 +56,8 @@ var TouchTestApp = React.createClass({
|
||||
collapsable={false}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
container: {
|
||||
|
||||
Reference in New Issue
Block a user