Closed ravanscafi closed 4 days ago
Thank you for the kind words! I'm glad the component is working well for you.
Regarding the haptic feedback suggestion, I think it's a great idea! However, we can achieve this without updating the package itself. Since the animation is triggered when the state updates, you can add haptic feedback externally using one of the following approaches:
Example 1: Using react-native-haptic-feedback
import HapticFeedback, { HapticFeedbackTypes } from 'react-native-haptic-feedback';
function hapticFeedback(type: HapticFeedbackTypes = 'impactLight', force = false) {
HapticFeedback.trigger(type, {
enableVibrateFallback: force,
ignoreAndroidSystemSettings: force,
});
}
useEffect(() => {
hapticFeedback();
}, [numberValue]); // Replace `numberValue` with the state controlling the animation
Example 2: Using expo-haptics
import * as Haptics from 'expo-haptics';
useEffect(() => {
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
}, [numberValue]); // Replace `numberValue` with the state controlling the animation
These approaches keep the package lightweight and avoid adding extra dependencies while still achieving the desired effect.
Hello! Thanks for the component, it works really well!
I would love a haptic feedback/effect when the numbers roll.
(it could also work with an
onAnimationStarts
event or something like that)What do you think?