这是我的问题。推送功能改变道具反应
当我使用push()函数时,它会改变我的道具反应。
const prioship = (this.props.orders.prioshipping === false ? {'name':`Regular Shipping`,'price':'0','currency':'EUR','quantity':1, 'description': ''} : {'name':`Priority Shipping`,'price': this.props.prices.shipping['A'].toString() ,'currency':'EUR','quantity':1, 'description': ''})
console.log('#### TOKEN ORDER #####1', this.props.orders.warenkorb)
const orders = this.props.orders.warenkorb
const order2 = this.props.orders.warenkorb
orders.push(prioship)
console.log('#### TOKEN ORDER #####2',order2, this.props.orders.warenkorb)
因此,即使在控制台日志的级别“TOKEN令1”这个道具在它的“prioship”即使在后面的代码发生。我不明白如何使它停止。我只想要一个变量'订单',其中有prioship,我不想让我的道具改变。
请帮忙