-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Improved performance on Table with a lot of columns (> 150) #942
Changes from 1 commit
2c2c17b
f5e598b
c707db6
76b17ae
8529620
720588c
7e961d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -453,13 +453,15 @@ export default class Table extends PureComponent { | |
a11yProps['aria-describedby'] = id; | ||
} | ||
|
||
a11yProps.key = "Row" + rowIndex + "-" + "Col" + columnIndex; | ||
a11yProps.className = cn('ReactVirtualized__Table__rowColumn', className); | ||
a11yProps.style = style; | ||
a11yProps.title = title; | ||
|
||
return ( | ||
<div | ||
{...a11yProps} | ||
key={`Row${rowIndex}-Col${columnIndex}`} | ||
className={cn('ReactVirtualized__Table__rowColumn', className)} | ||
style={style} | ||
title={title}> | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like the crux of this fix is to avoid generating sub-optimal I'd suggest adding a comment about why it's important not to mix inline props and spread props. |
||
{renderedCell} | ||
</div> | ||
); | ||
|
@@ -523,7 +525,7 @@ export default class Table extends PureComponent { | |
? SortDirection.ASC | ||
: SortDirection.DESC; | ||
|
||
const onClick = event => { | ||
const onClick = event => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: trailing whitespace |
||
sortEnabled && | ||
sort({ | ||
sortBy: dataKey, | ||
|
@@ -553,12 +555,13 @@ export default class Table extends PureComponent { | |
a11yProps.id = id; | ||
} | ||
|
||
a11yProps.key = "Header-Col" + index; | ||
a11yProps.className = classNames; | ||
a11yProps.style = style; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same move and rename to headerProps |
||
return ( | ||
<div | ||
{...a11yProps} | ||
key={`Header-Col${index}`} | ||
className={classNames} | ||
style={style}> | ||
{...a11yProps}> | ||
{renderedHeader} | ||
</div> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move all these props to object literal and rename
a11yProps
tocellProps
?