Skip to content

Commit

Permalink
replaced deprecated method for removing .addEventListener subscription (
Browse files Browse the repository at this point in the history
#75)

* replaced deprecated method for removing .addEventListener subscription

* package version bup to 2.0.8
  • Loading branch information
matapo authored Jul 21, 2022
1 parent ef6db91 commit 572d39b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Swiper extends Component {
this._mounted = false
this.state.pan.x.removeAllListeners()
this.state.pan.y.removeAllListeners()
Dimensions.removeEventListener('change', this.onDimensionsChange)
this.dimensionsChangeSubscription.remove()
}

getCardStyle = () => {
Expand All @@ -110,7 +110,7 @@ class Swiper extends Component {

initializeCardStyle = () => {
// this.forceUpdate()
Dimensions.addEventListener('change', this.onDimensionsChange)
this.dimensionsChangeSubscription = Dimensions.addEventListener('change', this.onDimensionsChange)
}

initializePanResponder = () => {
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.7",
"version": "2.0.8",
"description": "Awesome tinder like card swiper for react-native. Highly Customizable!",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 572d39b

Please sign in to comment.