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.
18 lines
564 B
18 lines
564 B
import { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs'; |
|
import { PlatformPressable } from '@react-navigation/elements'; |
|
import * as Haptics from 'expo-haptics'; |
|
|
|
export function HapticTab(props: BottomTabBarButtonProps) { |
|
return ( |
|
<PlatformPressable |
|
{...props} |
|
onPressIn={(ev) => { |
|
if (process.env.EXPO_OS === 'ios') { |
|
// Add a soft haptic feedback when pressing down on the tabs. |
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); |
|
} |
|
props.onPressIn?.(ev); |
|
}} |
|
/> |
|
); |
|
}
|
|
|