How to use the expo-haptics.selectionAsync function in expo-haptics

To help you get started, we’ve selected a few expo-haptics 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 Flaque / quirk / src / haptic.ts View on Github external
selection: () => {
    if (Platform.OS !== "ios") {
      return;
    }
    Haptic.selectionAsync();
  },
  impact: type => {
github expo / expo / apps / native-component-list / src / screens / HapticsScreen.tsx View on Github external
accessor: 'Haptics.ImpactFeedbackStyle.Light',
        value: Haptics.ImpactFeedbackStyle.Light,
      },
      {
        accessor: 'Haptics.ImpactFeedbackStyle.Medium',
        value: Haptics.ImpactFeedbackStyle.Medium,
      },
      {
        accessor: 'Haptics.ImpactFeedbackStyle.Heavy',
        value: Haptics.ImpactFeedbackStyle.Heavy,
      },
    ],
  },
  {
    methodName: 'selectionAsync',
    method: Haptics.selectionAsync,
    data: [{}],
  },
];

export default class HapticsScreen extends React.Component {
  static navigationOptions = {
    title: 'Haptics Feedback',
  };

  renderItem = ({
    item,
    section: { method },
  }: {
    item: { accessor: string; value: any };
    section: { method: (type: string) => void };
  }) =>

expo-haptics

Provides access to the system's haptics engine on iOS and vibration effects on Android.

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis