@sapkalabs/react-native-shake
v0.1.0
Published
React Native shake event detector
Maintainers
Readme
react-native-shake
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.
Installation
npm install react-native-shakeUsage
import { 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;
};
}, []);Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
