-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Include typescript definitions #299
Comments
I was just thinking to ask on that DefinitelyTyped issue for some help 😄 I have no idea how do they work: is it just adding a react-day-picker.d.ts to the package? Need to investigate a bit (or if you have some spare time, I'd be happy to merge a PR). As for the tests, we could just copy what moment is doing there! |
Type definitions have been released in |
It doesn't appear to work for LocaleUtils:
Not entirely sure how to fix it, my typescript experience is so far fairly limited. |
@phaza try react-day-picker/types/index.d.ts Line 5 in 7d26252
|
I tried the following in Typescript 2.0 project:
I get the following error message when I run the Typescript compiler
|
@lpcarignan the package uses import * as ReactDayPicker from "react-day-picker";
<ReactDayPicker ... /> see https://github.com/palantir/blueprint/blob/master/packages/datetime/src/datePicker.tsx#L11 |
@giladgray Thx for the quick response and the link to the project on which I can get some ideas. I roughly copy/pasted the ReactDatePicker element in the example you sent. After playing around for a bit, I get a very ugly ReactDatePicker where all of the days and dates of the month are stacked. In the example you sent me, there's a div with a className refering to DatePicker. Do I have to consider the .css of the ReactDatePicker when I use the component in my code? When I look at the examples, it begins by including
I can't do that in TypeScript. To add to the mix, I'm using semantic-ui-react as my React library and I bundle my app into a single .js with Webpack. |
@lpcarignan check http://react-day-picker.js.org/docs/styling.html for more info about styling the component. Please open a new issue or write in the gitter room for questions not related to this issue, thanks 🙏🏽👍🏽 |
@lpcarignan you'll need to include the css file somehow, either as a |
Thanks for all of your help guys with my newbie questions. It is much appreciated. |
this package is dependence heavy i uninstalled it. |
@gpbl what do you think about including typescript definitions in this repo and the published NPM package? The blueprint maintainers could likely help you maintain them. The moment package, among others, does this: https://github.com/moment/moment/blob/develop/moment.d.ts.
I guess the one downside here is that you don't automatically get the testing infrastructure of DefinitelyTyped (you'd have to build some yourself if you wanted it). Upside is that the definitions are more likely to stay up to do date. See DefinitelyTyped/DefinitelyTyped#16010
cc @giladgray
The text was updated successfully, but these errors were encountered: