Impact
Trigger impact haptic feedback with Haptics.impact().
Triggers an impact haptic feedback. This corresponds to UIImpactFeedbackGenerator on iOS. On Android, it simulates the equivalent vibration effect.
Haptics.impact(style: ImpactFeedback): Promise<void>ImpactFeedback type
light: a collision between small, light user interface elements.medium: a collision between moderately sized user interface elements.heavy: a collision between large, heavy user interface elements.soft: a collision between user interface elements that are soft, with a large amount of compression or elasticity. (iOS 13.0+)rigid: a collision between user interface elements that are rigid, with a small amount of compression or elasticity. (iOS 13.0+)
Example usage
import {ImpactFeedback} from '@mhpdev/react-native-haptics';
// Trigger a heavy impact
Haptics.impact('heavy');
// Trigger a light impact
Haptics.impact('light');Passing a value that is not one of the styles above rejects the returned promise with E_INVALID_STYLE — see Troubleshooting.