Is there a better way to validate if a number is inside a range?
Avoiding to write
PropTypes.oneOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
You could use airbnb's extension to proptypes which support the range PropType
range
range: provide a min, and a max, and the prop must be an integer in the range [min, max) foo: range(-1, 2)