prop types or code example
Example 1: how to make proptypes either or
size: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
Example 2: proptypes shape
PropTypes.shape({ name: PropTypes.string, age: PropTypes.number })
size: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
PropTypes.shape({ name: PropTypes.string, age: PropTypes.number })