score:4

Accepted answer
this.replaceState(Object.assign({}, { [id]: !this.state[id] });

Related Query

More Query from same tag