assisrafael / react-bootstrap-utils

React bootstrap library
MIT License
6 stars 6 forks source link

Issue with the 'required' prop in a Form child #23

Closed vbarcellos closed 4 years ago

vbarcellos commented 4 years ago

Right now the 'required' prop is just a boolean, but it would be nice to have it accept a function just like the 'disabled' prop so we can make conditional requirements

Current:

FormInput.propTypes = {
  required: PropTypes.bool,
  disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
};

Proposed:

FormInput.propTypes = {
  required: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
  disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
};
assisrafael commented 4 years ago

Fixed on v0.19.0