componentDidUpdate()

in src/routes/Plugin/PluginRuleHandle/ResponseRuleHandle.js [130:147]


  componentDidUpdate() {
    const { onChange, value } = this.props;
    const data = {};
    const currentData = this.getCurrentData();
    const valueStr = JSON.stringify(currentData);
    if (value !== undefined) {
      try {
        Object.assign(data, JSON.parse(value));
      } catch (e) {
        // eslint-disable-next-line no-console
        console.error(e);
      }
    }

    if (valueStr !== value && onChange) {
      onChange(valueStr);
    }
  }