react-input-range
react-input-range copied to clipboard
Warning from range-prop-type
Hello. Despite on props allowSameValues
, i get warning "minValue" must be smaller than "maxValue"
.
This warning is produced by range-prop-type
, where not any check on allowSameValues
. The code from source file :
if (minValue >= maxValue) {
return new Error('"minValue" must be smaller than "maxValue"');
}
I get the same error
Me too, it's very annoying. Would love to see this fixed. I would suggest modifying the rangePropType
custom proptype to this:
if (minValue > maxValue) {
return new Error('"minValue" must be smaller than "maxValue"');
}
This means that a proptype warning will not be thrown in the case where allowSameValues
is false and minValue === maxValue
. But when the definition of a "range" is configurable, I'm not sure it makes much sense to rely on proptypes validation to enforce the rules anyway.
I also receive the error. Thank you for fixing it!