react-input-range icon indicating copy to clipboard operation
react-input-range copied to clipboard

Warning from range-prop-type

Open ns4style opened this issue 6 years ago • 3 comments

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"');
  }

ns4style avatar Oct 25 '18 11:10 ns4style

I get the same error

xFloooo avatar Nov 14 '18 08:11 xFloooo

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.

elainemacurdy avatar Jul 29 '19 19:07 elainemacurdy

I also receive the error. Thank you for fixing it!

yossicahen avatar Jul 31 '19 13:07 yossicahen