From a528bd94a6e8e25010ae26a305550b211df0ddc6 Mon Sep 17 00:00:00 2001 From: polwex Date: Tue, 15 Jul 2025 17:20:58 +0700 Subject: Initial commit Generated by create-expo 3.4.3. --- components/HapticTab.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 components/HapticTab.tsx (limited to 'components/HapticTab.tsx') diff --git a/components/HapticTab.tsx b/components/HapticTab.tsx new file mode 100644 index 0000000..7f3981c --- /dev/null +++ b/components/HapticTab.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 ( + { + 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); + }} + /> + ); +} -- cgit v1.2.3