Skip to content

5.1.0 release

Compare
Choose a tag to compare
@Doko-Demo-Doa Doko-Demo-Doa released this 02 Nov 07:37
· 56 commits to main since this 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()
    }
  }, [])
}