score:4

Accepted answer
this.setState((prevState) => ({ data: { ...prevState.data, [key]: data } }));

Related Query

More Query from same tag