Releases: Doko-Demo-Doa/react-native-shake
Releases · Doko-Demo-Doa/react-native-shake
5.1.0 release
With this new release, I have removed removeListener
as addListener
method now returns an EmitterSubscription
, allows you to create and use multiple RNShake instances. Example with useEffect
hook:
import React from 'react'
export const MyComponent = () => {
React.useEffect(() => {
const subscription = RNShake.addListener(() => {
// Your code here...
})
return () => {
// Your code here...
subscription.remove()
}
}, [])
}
4.0.2
It's been a while, but I can finally come back to this project. With this new version, we have:
- Fully typed code with TypeScript.
- Rewritten iOS module. It now works on both Debug and Release mode.
- Shorter API.
Breaking changes
- The lib now uses
NativeEventEmitter
because old bridge implementation is deprecated. Worry not, little will change. - 4 methods under the hood:
- addListener
- removeListener
- removeAllListeners
- removeCurrentListener
and they all returnEmitterSubscription
, fully compatible with React Hooks.
I'm planning to expose a parameter to configure tension too. Stay tuned.
Feel free to try and give me the feedback:
npm install [email protected]
3.5.0
3.1.0 released
- Fixed compatibility with React Native 0.47.1