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