React Native shake event detector
npm install @sapkalabs/react-native-shakeReact Native shake event detector.
Made with create-react-native-library.
Special thanks to the authors of the RNBB library. This wouldn't be possible without this plugin.
> Important: This package only supports React Native's New Architecture and is based on React Native 0.78.0.
``sh`
npm install react-native-shake
`TypeScript
import { Shake } from 'react-native-shake';
// ...
const result = Shake.multiply(3, 7);
// ...
const listenerSubscription = React.useRef
// ...
useEffect(() => {
// INIT
listenerSubscription.current = Shake.onShake(() => {
console.log('Shake event detected!');
});
// DE-INIT
return () => {
listenerSubscription.current?.remove();
listenerSubscription.current = null;
};
}, []);
``
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
---