Using immutability-helper in React, update multiple values in one pass
Can you update two or more values in a nested state using one update method call from immutability-helper? I tried the code below but only the last line [elementIndex]: {fouls: {$set: 1 }} gets implemented. this.state={ players:[{points: 0, fouls: 0, name: ‘bob’}, {points: 0, fouls: 0, name: ‘joe’}] } const element = this.state.players.findIndex(el => el.name… Read More Using immutability-helper in React, update multiple values in one pass