diff --git a/CardStack.js b/CardStack.js index a879797..45f0718 100644 --- a/CardStack.js +++ b/CardStack.js @@ -138,10 +138,10 @@ export default class CardStack extends Component { componentWillReceiveProps(nextProps){ if (nextProps.children !== this.props.children) { this.setState({ - cards: nextProps.children, - cardA: nextProps.children[0], - cardB: nextProps.children[1], - }); + cards: nextProps.children, + cardA: nextProps.children[(this.state.topCard=='cardA')? this.state.sindex-2 : this.state.sindex-1], + cardB: nextProps.children[(this.state.topCard=='cardB')? this.state.sindex-2 : this.state.sindex-1] + }); } } diff --git a/package.json b/package.json index 254be3f..cf152d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-card-stack-swiper", - "version": "1.0.47", + "version": "1.0.5", "description": "Tinder like react-native card stack swiper", "main": "index.js", "scripts": {