React 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.
npm install react-native-shakeimport { Shake } from 'react-native-shake';
// ...
const result = Shake.multiply(3, 7);
// ...
const listenerSubscription = React.useRef<null | EventSubscription>(null);
// ...
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