mirror of
https://github.com/zhigang1992/react-native-card-stack-swiper.git
synced 2026-01-12 17:42:18 +08:00
Update props fix
Updating the data on the visible card, without restarting the deck
This commit is contained in:
@@ -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]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user