slider icon indicating copy to clipboard operation
slider copied to clipboard

SliderProps type' ValueType stuck as `number | number[]`

Open KaWaite opened this issue 3 years ago • 4 comments

In our project, the ValueType needs to be number | undefined. The SliderProps type was updated to default its ValueType to number | number[]. It's using generics now so should be modifiable, but the Slider component itself is not setup to be passed a value for ValueType...

KaWaite avatar May 27 '22 00:05 KaWaite

Create a new file called custom-slider.tsx then add:

import RcSlider, { SliderProps, SliderRef } from 'rc-slider/lib/Slider';

export const CustomSlider = RcSlider as React.ForwardRefExoticComponent<SliderProps<number | undefined> & React.RefAttributes<SliderRef>>;

then import CustomSlider to your file

ossamaweb avatar Aug 01 '22 22:08 ossamaweb

Will there be a fix to this issue with a library update?

gayancharith avatar Nov 23 '22 10:11 gayancharith

PR welcome

afc163 avatar Nov 23 '22 10:11 afc163

Any updates?

xsjcTony avatar May 31 '23 02:05 xsjcTony