-
-
Notifications
You must be signed in to change notification settings - Fork 795
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 shouldForceUpdate to resetAfterIndex #32
Changes from 1 commit
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 |
---|---|---|
|
@@ -96,39 +96,59 @@ const PROPS = [ | |
const METHODS = [ | ||
{ | ||
description: ( | ||
<p> | ||
<code>VariableSizeGrid</code> caches offsets and measurements for each | ||
column index for performance purposes. This method clears that cached | ||
data for all columns after (and including) the specified index. It | ||
should be called whenever a column's width changes. (Note that this is | ||
not a typical occurrance.) | ||
</p> | ||
<Fragment> | ||
<p> | ||
<code>VariableSizeGrid</code> caches offsets and measurements for each | ||
column index for performance purposes. This method clears that cached | ||
data for all columns after (and including) the specified index. It | ||
should be called whenever a column's width changes. (Note that this is | ||
not a typical occurrance.) | ||
</p> | ||
<p> | ||
You can set <code>shouldForceUpdate</code> to <code>false</code> | ||
to prevent the list calling <code>forceUpdate</code> internally. | ||
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. I don't think this is enough of an explanation. Maybe something more like:
(And similar for the below blocks.) |
||
</p> | ||
</Fragment> | ||
), | ||
signature: 'resetAfterColumnIndex(index: number): void', | ||
signature: | ||
'resetAfterColumnIndex(index: number, shouldForceUpdate: boolean = true): void', | ||
}, | ||
{ | ||
description: ( | ||
<p> | ||
<code>VariableSizeGrid</code> caches offsets and measurements for each | ||
item for performance purposes. This method clears that cached data for | ||
all items after (and including) the specified indices. It should be | ||
called whenever an items size changes. (Note that this is not a typical | ||
occurrance.) | ||
</p> | ||
<Fragment> | ||
<p> | ||
<code>VariableSizeGrid</code> caches offsets and measurements for each | ||
item for performance purposes. This method clears that cached data for | ||
all items after (and including) the specified indices. It should be | ||
called whenever an items size changes. (Note that this is not a | ||
typical occurrance.) | ||
</p> | ||
<p> | ||
You can set <code>shouldForceUpdate</code> to <code>false</code> | ||
to prevent the list calling <code>forceUpdate</code> internally. | ||
</p> | ||
</Fragment> | ||
), | ||
signature: | ||
'resetAfterIndices({ columnIndex: number, rowIndex: number }): void', | ||
'resetAfterIndices({ columnIndex: number, rowIndex: number, shouldForceUpdate: boolean = true }): void', | ||
}, | ||
{ | ||
description: ( | ||
<p> | ||
<code>VariableSizeGrid</code> caches offsets and measurements for each | ||
row index for performance purposes. This method clears that cached data | ||
for all rows after (and including) the specified index. It should be | ||
called whenever a row's height changes. (Note that this is not a typical | ||
occurrance.) | ||
</p> | ||
<Fragment> | ||
<p> | ||
<code>VariableSizeGrid</code> caches offsets and measurements for each | ||
row index for performance purposes. This method clears that cached | ||
data for all rows after (and including) the specified index. It should | ||
be called whenever a row's height changes. (Note that this is not a | ||
typical occurrance.) | ||
</p> | ||
<p> | ||
You can set <code>shouldForceUpdate</code> to <code>false</code> | ||
to prevent the list calling <code>forceUpdate</code> internally. | ||
</p> | ||
</Fragment> | ||
), | ||
signature: 'resetAfterRowIndex(index: number): void', | ||
signature: | ||
'resetAfterRowIndex(index: number, shouldForceUpdate: boolean = true): void', | ||
}, | ||
]; |
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.
I think the way the "should recalculate the estimated total size" test checks for this is a bit more robust. (It checks to see if the
columnWidth
orrowHeight
getter functions have been called.)forceUpdate
is kind of an implementation detail (e.g. maybe the grid re-renders usingsetState
instead?)