Slider: Failed prop type: Invalid prop `value` supplied to `Slider`.

Created on 19 Dec 2016  路  2Comments  路  Source: react-component/slider

I'm getting these two warnings Failed prop type: Invalid prop value supplied to Slider and Failed prop type: Invalid prop defaultValue supplied to Slider.

I don't see any issues, everything works fine, but I get those warnings in the console.

The render function is as follows :

         const min = this.props.min;
         const max = this.props.max;       
         const low = this.state.low;
         const high = this.state.high;
         console.log("Low : " + low);
         console.log("High : " + high);
         console.log("Min : " + min);
         console.log("Max : " + max);

         return (
            <div>
                   <Rcslider min={min} max={max} range allowCross={false} defaultValue={[low, high]} value={[low, high]} onChange={this.handleRangeChange.bind(this)}/>
           </div>
         )

The result for the state values which I get when the component renders is :

       Low : 123
       High : 827256
       Min : 123
       Max : 827256

What am I doing wrong?

Most helpful comment

make sure low/high are numbers and not strings

All 2 comments

A re-producible online demo, please.

make sure low/high are numbers and not strings

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dvshur picture dvshur  路  3Comments

gpinhey picture gpinhey  路  6Comments

eldyvoon picture eldyvoon  路  6Comments

johnb8005 picture johnb8005  路  6Comments

nmccrea-db picture nmccrea-db  路  5Comments