Closed earllapura closed 4 years ago
Hey, there. I see what the issue is. I updated master to Typescript and I'm still working on it (master is what's in the beta version). You are using the library version 2.4 which was in JS. So you're kind of caught up in this transition period.
However, good point on the readonly. I should update that. This was the original discussion around that https://github.com/sghall/react-compound-slider/pull/21.
Ok. I just published a new beta version of 3.0 (3.0.0-beta.1
) and updated the master branch with all the arrays as ReadonlyArray<number>
. So the demos should work if you take them off master.
I updated this TS sandbox to confirm it works with readonly values passed in: https://codesandbox.io/s/6zpjmw1x3w
If anyone wants to install the beta (npm install react-compound-slider@beta
) and provide any feedback, please feel free. Hoping to get everything done over the next couple of weeks.
Thanks for raising the issue.
@sghall Thanks for the tip!
https://github.com/sghall/react-compound-slider/blob/f3ea10e62671ee91b0d2719d73f1d250813457b4/docs/src/demos/horizontal/Example2.tsx#L24
I tried to use the example for my project using the library with version 2.4, React v16.11 and Typescript 3.7.2. However, I get the error as seen below
Shouldn't the parameter be
ReadonlyArray<number>
?