async handleOnClick(i){
await this.setState({
selectCard: {
...this.state.selectCard,
[i]: !this.state.selectCard[i]
}
},() => {this.amountSelectSwatches(this.state.selectCard,i)}); // вызов счетчика
}
amountSelectSwatches(obj,ind){
if(obj[ind]===true){
await this.setState({
count:Object.assign({},this.state.count,{[ind]:++this.state.count[ind]})
})
}}
handleOnClick(i){
this.setState({
selectCard: {
...this.state.selectCard,
[i]: !this.state.selectCard[i]
}
},() => {this.amountSelectSwatches(this.state.selectCard,i)}); // вызов счетчика
}
amountSelectSwatches(obj,ind){
if(obj[ind]===true){
this.setState({
count:Object.assign({},this.state.count,{[ind]:++this.state.count[ind]})
})
}}
https://wix.github.io/react-native-navigation/#/sc... это пробуйте