react-native-swipable-cards
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "react-native-swipable-cards", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Swipable cards with different behaviors", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -1,2 +0,2 @@ | ||
import React, { Component } from 'react' | ||
import React, { PureComponent } from 'react' | ||
@@ -15,3 +15,3 @@ import { | ||
class SwipableCards extends Component { | ||
class SwipableCards extends PureComponent { | ||
constructor(props) { | ||
@@ -59,3 +59,3 @@ super(props) | ||
componentWillReceiveProps(nextProps) { | ||
if (nextProps.cards && nextProps.cards.length > 0) { | ||
if (nextProps.cards && nextProps.cards.length > 0 && this.props.cards !== nextProps.cards) { | ||
this.setState({ | ||
@@ -76,3 +76,3 @@ card: nextProps.cards[0], | ||
onShouldBlockNativeResponder: () => true, | ||
onMoveShouldSetPanResponder: (evt, { dx }) => Math.abs(dx) > 5, | ||
onMoveShouldSetPanResponder: (evt, { dx }) => !this.props.disableGestures && Math.abs(dx) > 5, | ||
@@ -316,2 +316,3 @@ onPanResponderTerminate: () => { | ||
renderNope: React.PropTypes.func, | ||
disableGestures: React.PropTypes.bool, | ||
renderNoMoreCards: React.PropTypes.func, | ||
@@ -339,2 +340,3 @@ logger: React.PropTypes.func, | ||
fadeOnSwipe: false, | ||
disableGestures: false, | ||
renderNoMoreCards: () => <View />, | ||
@@ -341,0 +343,0 @@ onCardRemoved: () => null, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13720
293