How to use the simple-react-form.Form.defaultProps function in simple-react-form

To help you get started, we’ve selected a few simple-react-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 nicolaslopezj / simple-react-form / material-ui / src / fields / array.jsx View on Github external
<div style={{ color: 'red' }}>{this.props.errorMessage}</div>
        <div className={this.props.parentClassName}>
          {this.renderChildren()}
        </div>
        <div style={{ marginTop: 10 }}>
          {this.renderAddButton()}
        </div>
      </div>
    );
  }
}

MaterialArray.propTypes = propTypes;
MaterialArray.defaultProps = defaultProps;

Form.defaultProps.arrayComponent = MaterialArray;

//ArrayComponent = MaterialArray;
github nicolaslopezj / simple-react-form / material-ui / src / fields / object.jsx View on Github external
};

export default class MaterialObject extends ObjectComponent {
  render() {
    return (
      <Paper style={{ marginTop: 20, marginBottom: 20, padding: 20 }}>
        <div style={styles.label}>{this.getLabel()}</div>
        <div style={{ color: 'red' }}>{this.props.errorMessage}</div>
        {this.renderChildren(this.props.children)}
      </Paper>
    );
  }
}

//MRF.Object = MaterialObject;
Form.defaultProps.objectComponent = MaterialObject;

//ObjectComponent = MaterialObject;