create-expo-cljs-app
Version:
Create a react native application with Expo and Shadow-CLJS!
44 lines (42 loc) • 1.5 kB
Flow
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
;
import type { Props as TouchableWithoutFeedbackProps } from '../TouchableWithoutFeedback';
import type { ViewProps } from '../View';
import * as React from 'react';
import { useCallback, useMemo, useState, useRef } from 'react';
import useMergeRefs from '../../modules/useMergeRefs';
import usePressEvents from '../../modules/usePressEvents';
import StyleSheet from '../StyleSheet';
import View from '../View';
type ViewStyle = $PropertyType<ViewProps, 'style'>;
type Props = $ReadOnly<{| ...TouchableWithoutFeedbackProps,
activeOpacity?: ?number,
style?: ?ViewStyle,
|}>;
/**
* A wrapper for making views respond properly to touches.
* On press down, the opacity of the wrapped view is decreased, dimming it.
*/
declare function TouchableOpacity(props: Props, forwardedRef: any): React.Node;
const styles = StyleSheet.create({
root: {
transitionProperty: 'opacity',
transitionDuration: '0.15s',
userSelect: 'none'
},
actionable: {
cursor: 'pointer',
touchAction: 'manipulation'
}
});
const MemoedTouchableOpacity = React.memo(React.forwardRef(TouchableOpacity));
MemoedTouchableOpacity.displayName = 'TouchableOpacity';
export default (MemoedTouchableOpacity: React.AbstractComponent<Props, React.ElementRef<typeof View>>);