Answers for "setState function loop"

0

setState function loop

const updatedState = {};

if (vars.length) {
  vars.forEach(v => {
    updatedState[v] = '';
    this.setState({
      ...this.state
      ...updatedState,
    });
  });
}
Posted by: Guest on November-19-2020

Browse Popular Code Answers by Language