File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
src/components/SwipeButton Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " rn-swipe-button" ,
3- "version" : " 1.3.7 " ,
3+ "version" : " 1.3.8 " ,
44 "description" : " react native swipe/slide button component" ,
55 "main" : " index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const SwipeButton = props => {
4848 setScreenReaderEnabled ( isEnabled ) ;
4949 } ;
5050 setIsUnmounting ( false ) ;
51- AccessibilityInfo . addEventListener ( 'change' , handleScreenReaderToggled ) ;
51+ const subscription = AccessibilityInfo . addEventListener ( 'change' , handleScreenReaderToggled ) ;
5252
5353 AccessibilityInfo . isScreenReaderEnabled ( ) . then ( isEnabled => {
5454 if ( isUnmounting ) {
@@ -59,10 +59,7 @@ const SwipeButton = props => {
5959
6060 return ( ) => {
6161 setIsUnmounting ( true ) ;
62- AccessibilityInfo . removeEventListener (
63- 'change' ,
64- handleScreenReaderToggled ,
65- ) ;
62+ subscription . remove ( ) ;
6663 } ;
6764 } , [ isUnmounting , screenReaderEnabled ] ) ;
6865
You can’t perform that action at this time.
0 commit comments