How to use the react-native-gesture-handler.createNativeWrapper function in react-native-gesture-handler

To help you get started, we’ve selected a few react-native-gesture-handler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IjzerenHein / react-native-shared-element / Example / src / components / viewPager / ViewPager.android.js View on Github external
// @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 (
github rainbow-me / rainbow / src / components / animations / ButtonPressAnimation.js View on Github external
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 = {
github software-mansion / react-native-gesture-handler / Example / combo / index.js View on Github external
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,
github rainbow-me / rainbow / src / components / animations / ButtonPressAnimation.js View on Github external
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',
};