Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript issue #290

Open
haiderhossain10 opened this issue Apr 28, 2023 · 1 comment
Open

Typescript issue #290

haiderhossain10 opened this issue Apr 28, 2023 · 1 comment

Comments

@haiderhossain10
Copy link

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

Image Link

@drwpow
Copy link

drwpow commented Aug 24, 2023

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} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants