diff options
| author | jciespuertodelacruz <jc.iespuertodelacruz@gmx.es> | 2026-01-20 08:49:52 +0000 |
|---|---|---|
| committer | jciespuertodelacruz <jc.iespuertodelacruz@gmx.es> | 2026-01-20 08:49:52 +0000 |
| commit | c6f2b6f85d151d6d2a2cc68eb05edd7a1e448106 (patch) | |
| tree | 1080219bee426d5d1372da6c31f138482c1544d7 /components/haptic-tab.tsx | |
Initial commit
Generated by create-expo-app 3.5.3.
Diffstat (limited to 'components/haptic-tab.tsx')
| -rw-r--r-- | components/haptic-tab.tsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/components/haptic-tab.tsx b/components/haptic-tab.tsx new file mode 100644 index 0000000..7f3981c --- /dev/null +++ b/components/haptic-tab.tsx @@ -0,0 +1,18 @@ +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); + }} + /> + ); +} |