NPSF3000
0
Q:

setState function loop

const updatedState = {};

if (vars.length) {
  vars.forEach(v => {
    updatedState[v] = '';
    this.setState({
      ...this.state
      ...updatedState,
    });
  });
}
0

New to Communities?

Join the community