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 possibility to inject header-row-renderer + typescript type declarations #600

Merged
merged 7 commits into from
Mar 4, 2017

Conversation

kaoDev
Copy link
Contributor

@kaoDev kaoDev commented Feb 28, 2017

This pull request enables the table to handle higher order components in the header row. It is needed to make the columns/headers sortable
Additionally I have added a declaration file for typescript to have better declarations than the @types/react-virtualized repo

@bvaughn
Copy link
Owner

bvaughn commented Feb 28, 2017

Hi @kaoDev,

Thank for submitting a PR. I'll be happy to review it as soon as I get the chance, though that might not be for a couple of days. I'm pretty swamped now.

I did want to make a quick note that I'm not really willing to take on the maintenance burden of TypeScript type declarations. I understand why they are useful- but I'm not a TypeScript user and I have enough of a challenge maintaining this project on my own as it is. Unless they can be auto-generated as part of the build process- they'll need to live somewhere externally so they can be owned by the community. I hope you understand!

@kaoDev
Copy link
Contributor Author

kaoDev commented Mar 1, 2017

Hey @bvaughn,
good to know you're on it. I will remove the TypeScript declarations and will commit it to the definitely typed repository. (But I can highly recommend to try out TypeScript 😀 )

the work on declarations will continue in the definitely typed repo
@bvaughn
Copy link
Owner

bvaughn commented Mar 1, 2017

Much appreciated 😄

I'm a fan of TypeScript! I've used it in the past. I mostly stick with Flow these days though because it's easier to consolidate my tech stack with work and OSS projects.

@bvaughn bvaughn merged commit d5fb07b into bvaughn:master Mar 4, 2017
</div>
this.props.headerRowRenderer({
className: cn('ReactVirtualized__Table__headerRow', rowClass),
style: rowStyleObject,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the style parameter passed should have all of the values preset, just like we pre-append a custom rowClass. This is more inline with what we do for other *renderer props. Users can then override (if they want) specific styles or just pass them through as-is by default.

I'll make this change myself before merging, just commenting to let you know my rationale.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok good to know

@@ -25,7 +33,7 @@ export type HeaderRendererParams = {

export type RowRendererParams = {
className: string,
columns: Array,
columns: any[],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why was this change required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I think it just slipped in when I implemented the new types, or perhaps I tried to find an easy to implement more specific type information for this array ;).
This change on it's own, is more or less a matter of taste any[] and Array should be the same in flowType.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I just wanted to ask in case there was a difference I was unaware of. 😄

@bvaughn
Copy link
Owner

bvaughn commented Mar 4, 2017

Merged with the change I mentioned. Thanks for the contribution! This will be released sometime this morning.

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.

2 participants