score:2

Accepted answer
  componentDidUpdate(prevProps, prevState) {
    if (prevState.dataToBeSent !== this.state.dataToBeSent) {
      const clean = this.state.dataToBeSent.find(data => !data.dirty);

      if (!clean) {
        // Add clean form
        this.addVendor();
      }
    }
  }

Related Query

More Query from same tag