slider
slider copied to clipboard
Change types of arrays on props to ReadonlyArray
We use ReadonlyArray in typescript alot, but we get an error passing it to rc-slider, even though you do mutate the array. Changing it would only allow more types to be passed afaik. I can make a PR if you indicate this would be accepted.
Can you provide reproduce example?
The range props are just arrays: https://github.com/react-component/slider/blob/master/src/Range.tsx#L37 So e.g. (off the top of my head)
const values: ReadonlyArray<number> = [1,2];
return <Range values={values} />;
@lukeapage Is there a typo in your original message, you do mutate instead of you don’t mutate, that might have confused the maintainers?