Skip to content
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

Add TypeScript definitions for React #346

Merged
merged 1 commit into from
Aug 28, 2019
Merged

Add TypeScript definitions for React #346

merged 1 commit into from
Aug 28, 2019

Conversation

chrisparton1991
Copy link
Contributor

Hi, thanks for all your work on this awesome library!

This PR adds TypeScript support for the React subproject. I've added a Rollup plugin to copy the type definitions to dist, where they are referenced by package.json.

All tests are passing and the build succeeds.

@Grsmto
Copy link
Owner

Grsmto commented Jul 26, 2019

Hi Chris,
That's awesome, good job.
Do you think the "right way" of doing this wouldn't be to do a PR to https://github.com/DefinitelyTyped/DefinitelyTyped instead of having the typings directly in here? I think that's how the TS community used to do. What do you think?

@chrisparton1991
Copy link
Contributor Author

Thanks, in my experience there's a split between libraries that contain their own type definitions and ones that use DefinitelyTyped.

For my current project, I'm using DefinitelyTyped for Jest, Lodash and React. Other libraries (Axios, Material UI, PIXI etc.) contain their own typings.

From an org member of DefinitelyTyped: "In an ideal world the definitions would be maintained by the library authors, but alas many do not care for TypeScript"

So for me, the ideal is to have the typings directly in the repo (which also means one less NPM dependency), but I'm totally happy to put them in DefinitelyTyped if you'd prefer they go there!

@Grsmto
Copy link
Owner

Grsmto commented Jul 30, 2019

Ok thanks for your explanation. I'm on vacations right now but will take a look when I'm back.
Good job!

@chrisparton1991
Copy link
Contributor Author

Thanks, enjoy your vacation!

@Grsmto
Copy link
Owner

Grsmto commented Aug 28, 2019

Merging, thanks!

@Grsmto Grsmto merged commit bf3ae5b into Grsmto:master Aug 28, 2019
@chrisparton1991
Copy link
Contributor Author

Thanks, much appreciated! Hope you had a nice holiday.

@chrisparton1991 chrisparton1991 deleted the add-react-typings branch August 28, 2019 01:20
@Grsmto Grsmto mentioned this pull request Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants