You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. import { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs';
  2. import { PlatformPressable } from '@react-navigation/elements';
  3. import * as Haptics from 'expo-haptics';
  4. export function HapticTab(props: BottomTabBarButtonProps) {
  5. return (
  6. <PlatformPressable
  7. {...props}
  8. onPressIn={(ev) => {
  9. if (process.env.EXPO_OS === 'ios') {
  10. // Add a soft haptic feedback when pressing down on the tabs.
  11. Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
  12. }
  13. props.onPressIn?.(ev);
  14. }}
  15. />
  16. );
  17. }