react-slider icon indicating copy to clipboard operation
react-slider copied to clipboard

Typescript issue

Open mdhaiderhossain opened this issue 2 years ago • 1 comments

When i use defaultValue={[0, 10000]} then getting error in typescript. How can i solve it?

Image Link

mdhaiderhossain avatar Apr 28 '23 12:04 mdhaiderhossain

The problem is in the DefinitelyTyped package, not this repo. If possible, you can try and declare a generic for ReactSliderProps, e.g.

import { ReactSliderProps } from 'react-slider';

const props: ReactSliderProps<number[]> = {
  defaultValue: [0, 100],
}

<ReactSlider defaultValue={props.defaultValue} />

drwpow avatar Aug 24 '23 17:08 drwpow