Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import * as React from 'react';
import NativeViewPager from '@react-native-community/viewpager';
import {createNativeWrapper} from 'react-native-gesture-handler';
const RNGHViewPager = createNativeWrapper(NativeViewPager, {
disallowInterruption: true,
});
type PropsType = {
data: any[],
renderItem: (data: {item: any, index: number}) => any,
getItemLayout: (item: any, index: number) => any,
initialItemIndex: number,
onItemSelected: (index: number) => any,
};
type StateType = {};
export class ViewPager extends React.PureComponent {
render() {
const {style, data, initialItemIndex, renderItem} = this.props;
return (
const {
block,
call,
Clock,
cond,
createAnimatedComponent,
event,
onChange,
proc,
stopClock,
Value,
} = Animated;
const { ACTIVE, CANCELLED, END, FAILED, UNDETERMINED } = State;
const AnimatedRawButton = createNativeWrapper(
createAnimatedComponent(PureNativeButton),
{
shouldActivateOnStart: true,
shouldCancelWhenOutside: true,
}
);
const AnimatedRawButtonPropBlacklist = [
'onLongPress',
'onPress',
'onPressStart',
];
const NOOP = () => undefined;
const HapticFeedbackTypes = {
TextInput,
RectButton,
createNativeWrapper,
} from 'react-native-gesture-handler';
import Slider from '@react-native-community/slider';
import { Swipeable, InfoButton } from '../rows';
import { DraggableBox } from '../draggable';
import { PinchableBox } from '../scaleAndRotate';
import { PressBox } from '../multitap';
import { LoremIpsum } from '../common';
const CHILD_REF = 'CHILD_REF';
const WrappedSlider = createNativeWrapper(Slider, {
shouldCancelWhenOutside: false,
shouldActivateOnStart: true,
disallowInterruption: true,
});
class TouchableHighlight extends Component {
static propTypes = View.propTypes;
static defaultProps = {
activeOpacity: 0.85,
underlayColor: 'black',
};
constructor(props) {
super(props);
this.state = { gestureHandlerState: State.UNDETERMINED };
this._pressedStyle = {
opacity: this.props.activeOpacity,
and,
timing,
startClock,
block,
call,
eq,
or,
set,
cond,
createAnimatedComponent,
event,
onChange,
stopClock,
} = Animated;
const AnimatedRawButton = createNativeWrapper(
createAnimatedComponent(PureNativeButton),
{
shouldActivateOnStart: true,
shouldCancelWhenOutside: true,
}
);
const HapticFeedbackTypes = {
impactHeavy: 'impactHeavy',
impactLight: 'impactLight',
impactMedium: 'impactMedium',
notificationError: 'notificationError',
notificationSuccess: 'notificationSuccess',
notificationWarning: 'notificationWarning',
selection: 'selection',
};