Skip to content

Commit cd263a2

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Backed out changeset 409acf8d3356
Differential Revision: D6789941 fbshipit-source-id: 30d431727a4615208f51293d071f9334584a2269
1 parent 42c410a commit cd263a2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Libraries/Components/Touchable/TouchableWithoutFeedback.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'use strict';
1313

1414
const EdgeInsetsPropType = require('EdgeInsetsPropType');
15-
const NativeMethodsMixin = require('NativeMethodsMixin');
1615
const React = require('React');
1716
const PropTypes = require('prop-types');
1817
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error
@@ -46,7 +45,7 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
4645
*/
4746
const TouchableWithoutFeedback = createReactClass({
4847
displayName: 'TouchableWithoutFeedback',
49-
mixins: [NativeMethodsMixin, TimerMixin, Touchable.Mixin],
48+
mixins: [TimerMixin, Touchable.Mixin],
5049

5150
propTypes: {
5251
accessible: PropTypes.bool,
@@ -160,7 +159,8 @@ const TouchableWithoutFeedback = createReactClass({
160159
},
161160

162161
touchableGetLongPressDelayMS: function(): number {
163-
return this.props.delayLongPress != null ? this.props.delayLongPress : 500;
162+
return this.props.delayLongPress === 0 ? 0 :
163+
this.props.delayLongPress || 500;
164164
},
165165

166166
touchableGetPressOutDelayMS: function(): number {
@@ -184,8 +184,7 @@ const TouchableWithoutFeedback = createReactClass({
184184
const style = (Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text') ?
185185
[child.props.style, {color: 'red'}] :
186186
child.props.style;
187-
188-
return React.cloneElement(child, {
187+
return (React: any).cloneElement(child, {
189188
accessible: this.props.accessible !== false,
190189
accessibilityLabel: this.props.accessibilityLabel,
191190
accessibilityComponentType: this.props.accessibilityComponentType,
@@ -194,7 +193,6 @@ const TouchableWithoutFeedback = createReactClass({
194193
testID: this.props.testID,
195194
onLayout: this.props.onLayout,
196195
hitSlop: this.props.hitSlop,
197-
...child.props,
198196
onStartShouldSetResponder: this.touchableHandleStartShouldSetResponder,
199197
onResponderTerminationRequest: this.touchableHandleResponderTerminationRequest,
200198
onResponderGrant: this.touchableHandleResponderGrant,

0 commit comments

Comments
 (0)