Skip to content

SapkaLabs/react-native-shake

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-shake

Usage

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


About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published