React Native Shake
What is this?
A lightweight React Native library that detects shake gestures on iOS and Android.
react-native-shake detects shake gestures on both iOS and Android. It supports React Native's New Architecture (Turbo Modules) as well as the old/legacy architecture, ships full TypeScript definitions, and has no heavy dependencies.
import RNShake from 'react-native-shake';
const subscription = RNShake.addListener(() => {
console.log('Device shaken!');
});
subscription.remove();Works best on real devices - shake detection is limited in simulators/emulators.
Requirements
| Minimum | |
|---|---|
| iOS | 13.0+ |
| Android | API 21+ (Android 5.0) |
| React Native | 0.68+ |
Quick links
Installation
npm install react-native-shake
# or
yarn add react-native-shakeiOS
cd ios && pod installAndroid
No additional configuration required - the library links automatically via autolinking (React Native 0.60+).