Flow Type TouchableOpacity
Reviewed By: yungsters Differential Revision: D7983709 fbshipit-source-id: 0f664c831b754277e344aa53b2dbed6b4f720cd5
This commit is contained in:
parent
6cfa4a360d
commit
44743c07ad
|
@ -23,10 +23,25 @@ const createReactClass = require('create-react-class');
|
||||||
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
|
||||||
const flattenStyle = require('flattenStyle');
|
const flattenStyle = require('flattenStyle');
|
||||||
|
|
||||||
|
import type {Props as TouchableWithoutFeedbackProps} from 'TouchableWithoutFeedback';
|
||||||
|
import type {ViewStyleProp} from 'StyleSheet';
|
||||||
|
|
||||||
type Event = Object;
|
type Event = Object;
|
||||||
|
|
||||||
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
||||||
|
|
||||||
|
type TVProps = $ReadOnly<{|
|
||||||
|
hasTVPreferredFocus?: ?boolean,
|
||||||
|
tvParallaxProperties?: ?Object,
|
||||||
|
|}>;
|
||||||
|
|
||||||
|
type Props = $ReadOnly<{|
|
||||||
|
...TouchableWithoutFeedbackProps,
|
||||||
|
...TVProps,
|
||||||
|
activeOpacity?: ?number,
|
||||||
|
style?: ?ViewStyleProp,
|
||||||
|
|}>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for making views respond properly to touches.
|
* A wrapper for making views respond properly to touches.
|
||||||
* On press down, the opacity of the wrapped view is decreased, dimming it.
|
* On press down, the opacity of the wrapped view is decreased, dimming it.
|
||||||
|
@ -115,7 +130,7 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const TouchableOpacity = createReactClass({
|
const TouchableOpacity = ((createReactClass({
|
||||||
displayName: 'TouchableOpacity',
|
displayName: 'TouchableOpacity',
|
||||||
mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],
|
mixins: [TimerMixin, Touchable.Mixin, NativeMethodsMixin],
|
||||||
|
|
||||||
|
@ -267,6 +282,6 @@ const TouchableOpacity = createReactClass({
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
}): any): React.ComponentType<Props>);
|
||||||
|
|
||||||
module.exports = TouchableOpacity;
|
module.exports = TouchableOpacity;
|
||||||
|
|
Loading…
Reference in New Issue