zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
891 stars 232 forks source link

Typescript support #148

Closed wavesbig closed 4 years ago

wavesbig commented 5 years ago

Are there @types packages provided

stonebk commented 5 years ago

Are there @types packages provided

Not currently. We do not use typescript in our projects at Zillow, so we don't currently have a need for it. If somebody would like to submit a PR, I'd be happy to review and merge!

lenilsonjr commented 4 years ago

fyi: while there's no types for react-slider, you can use //@ts-ignore right before the module import to use the package without typechecking:

//@ts-ignore
import ReactSlider from 'react-slider';
waynevanson commented 4 years ago

Types are available, but need to be updated and generics added: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-slider

Alternatively, I'd be happy and would prefer to rewrite this in typescript to future proof it.

Which would you prefer @mpowaga?

waynevanson commented 4 years ago

I just submitted a thick PR to DefinitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/40094

I used the prop types, assuming they're in date.

waynevanson commented 4 years ago

@stonebk

stonebk commented 4 years ago

@waynevanson, thanks for looking into this! Yes, the prop types should be up to date. Forgive my ignorance, does anything need to happen within this project, or do people just pull the definitions directly from definitelytyped?

waynevanson commented 4 years ago

@waynevanson, thanks for looking into this! Yes, the prop types should be up to date. Forgive my ignorance, does anything need to happen within this project, or do people just pull the definitions directly from definitelytyped?

People pull the definitions by running yarn add -D @types/react-slider :)

stonebk commented 4 years ago

@waynevanson does this make sense? https://github.com/zillow/react-slider/pull/155

waynevanson commented 4 years ago

@stonebk yes it does!

waynevanson commented 4 years ago

@stonebk My pull got rejected, so all credit goes to: