-
Notifications
You must be signed in to change notification settings - Fork 695
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
Support Typescript #260
Comments
There is a @types/react-date-range package, but there have been a lot of type changes since it was last update 9 months ago |
Just a heads-up. Do NOT install |
Hi @smajl I just use the declare module 'react-date-range'; for types. I also want to use locale module so I put another declare in types.d.ts like this |
@futurify-ydang Maybe because there is no such file as declare module 'react-date-range/dist/locale'; // the correct path
import { vi } from 'react-date-range/dist/locale'; or import directly from import vi from 'date-fns/locale/vi';
// or
import { vi } from 'date-fns/locale'; and then pass it into |
Has somebody from authors considered creating PR in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-date-range for current version? |
I'm newish it Typescript. I use it when writing JavaScript, but don't know a lot about manipulating d.ts files. Could you please be more specific as to where I use the "declare module 'react-date-range'" line of code? Or at least point me in the direction or where I can read about it? I have searched online, searched my node-modules folder for an example, but I can't find any that looks like it will do what I need. Any help is greatly appreciated. BTW, I LOVE this module. Thank you so much for all the hard work, and maybe I can help out in some way in the near future! Jeremy Antoine |
@Therapychild Hi Jeremy, all you need is e.g. here: https://github.com/typescript-cheatsheets/react#the-types-i-need-dont-exist |
Thank you very much. I have been using typescript for a year and use it everyday in my coding, just never came across this issue before. I’m happy to learn something new! Thank you!
Jeremy
… On Apr 12, 2021, at 7:48 AM, Jan Peša ***@***.***> wrote:
@Therapychild Hi Jeremy, all you need is e.g. here: https://github.com/typescript-cheatsheets/react#the-types-i-need-dont-exist
And the rest of that cheatsheet should be also very helpful, I recommend you read it. Enjoy coding!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Isn't this s stale issue? I think this can be marked as closed, no? |
Do you support this version for typescript?
The text was updated successfully, but these errors were encountered: