How to use the react-jsonschema-form/lib/utils.deepEquals function in react-jsonschema-form

To help you get started, we’ve selected a few react-jsonschema-form examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudwan / gohan_webui / src / Form / formComponents / fields / ObjectField.js View on Github external
function objectKeysHaveChanged(formData, state) {
  // for performance, first check for lengths
  const newKeys = Object.keys(formData);
  const oldKeys = Object.keys(state);
  if (newKeys.length < oldKeys.length) {
    return true;
  }
  // deep check on sorted keys
  if (!deepEquals(newKeys.sort(), oldKeys.sort())) {
    return true;
  }

  return false;
}
github RxNT / react-jsonschema-form-conditionals / src / applyRules.js View on Github external
return runRules(formData).then(conf => {
          let dataChanged = !deepEquals(this.formData, conf.formData);
          this.formData = conf.formData;

          let newState = { schema: conf.schema, uiSchema: conf.uiSchema };
          let confChanged = !deepEquals(newState, this.state);
          if (dataChanged || confChanged) {
            this.shouldUpdate = true;
            this.setState(newState);
          }

          return conf;
        });
      }
github RxNT / react-jsonschema-form-conditionals / src / utils.js View on Github external
    field => !deepEquals(formData[field], changedFormData[field])
  );
github RxNT / react-jsonschema-form-conditionals / src / applyRules.js View on Github external
componentWillReceiveProps(nextProps) {
        let formDataChanged =
          nextProps.formData && !deepEquals(nextProps.formData, this.formData);
        if (formDataChanged) {
          this.updateConf(nextProps.formData);
          this.shouldUpdate = true;
        } else {
          this.shouldUpdate =
            this.shouldUpdate ||
            !deepEquals(
              nextProps,
              Object.assign({}, this.props, { formData: nextProps.formData })
            );
        }
      }
github RxNT / react-jsonschema-form-conditionals / src / rulesRunner.js View on Github external
).then(conf => {
      if (deepEquals(conf.formData, formData)) {
        return conf;
      } else {
        return doRunRules(
          engine,
          conf.formData,
          schema,
          uiSchema,
          extraActions
        );
      }
    });
  };
github RxNT / react-jsonschema-form-extras / src / CollapsibleField.js View on Github external
    if (formData.some(v => deepEquals(v, newVal))) {
      return formData;
github RxNT / react-jsonschema-form-conditionals / src / applyRules.js View on Github external
componentWillReceiveProps(nextProps) {
        let formDataChanged =
          nextProps.formData && !deepEquals(nextProps.formData, this.formData);
        if (formDataChanged) {
          this.updateConf(nextProps.formData);
          this.shouldUpdate = true;
        } else {
          this.shouldUpdate =
            this.shouldUpdate ||
            !deepEquals(
              nextProps,
              Object.assign({}, this.props, { formData: nextProps.formData })
            );
        }
      }