Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
webraptor committed Oct 5, 2022
1 parent 346d8c2 commit 736cb79
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions Swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ class Swiper extends Component {
return propsChanged || stateChanged
}

componentWillUnmountAfterInteractions = () => {
this.state.pan.x.removeAllListeners()
this.state.pan.y.removeAllListeners()
this.dimensionsChangeSubscription?.remove()
}

componentWillUnmount = () => {
this._mounted = false
InteractionManager.runAfterInteractions(() => {
this.state.pan.x.removeAllListeners()
this.state.pan.y.removeAllListeners()
this.dimensionsChangeSubscription?.remove()
})
this._mounted = false;
InteractionManager.runAfterInteractions(componentWillUnmountAfterInteractions.bind(this));
}

getCardStyle = () => {
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare module 'react-native-deck-swiper' {
onSwipedLeft?: (cardIndex: number) => void;
onSwipedRight?: (cardIndex: number) => void;
onSwipedTop?: (cardIndex: number) => void;
onSwiping?: () => void;
onSwiping?: (x: number, y: number) => void;
onTapCard?: (cardIndex: number) => void;
onTapCardDeadZone?: number;
outputCardOpacityRangeX?: [number, number, number, number, number];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-deck-swiper",
"version": "2.0.9",
"version": "2.0.10",
"description": "Awesome tinder like card swiper for react-native. Highly Customizable!",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 736cb79

Please sign in to comment.