warnings/proptypes: use oneOfType to support object and string

This commit is contained in:
abumalick 2017-06-04 17:18:43 +02:00 committed by David Calavera
parent fdf1826388
commit e23f7e69dd
2 changed files with 8 additions and 2 deletions

View File

@ -8,7 +8,10 @@ class ControlHOC extends Component {
static propTypes = {
controlComponent: PropTypes.func.isRequired,
field: ImmutablePropTypes.map.isRequired,
value: PropTypes.node,
value: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
]),
metadata: ImmutablePropTypes.map,
onChange: PropTypes.func.isRequired,
onValidate: PropTypes.func.isRequired,

View File

@ -19,5 +19,8 @@ export default class DateTimeControl extends React.Component {
DateTimeControl.propTypes = {
onChange: PropTypes.func.isRequired,
value: PropTypes.object, // eslint-disable-line
value: PropTypes.oneOfType([
PropTypes.object,
PropTypes.string,
]),
};