react propthpes or

JavaScript
size: PropTypes.oneOfType([
  PropTypes.string,
  PropTypes.number
]),
Source

Also in JavaScript: