Create new reusable id-based cache for CellMeasurer
See original GitHub issueThe default cache for CellMeasurer
currently stores sizes using indices. It should be possible to store these values using (data) ids instead so that changes to the underlying data (eg sorting, new rows appended) wouldn’t invalidate the cached sizes. This would be useful for things like reverse-ordered lists (eg chat).
cc @zsherman
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:6 (3 by maintainers)
Top Results From Across the Web
react-virtualized share CellMeasurerCache for multiple Grids
You can't directly share a CellMeasurerCache cache between Grid s unless the content of all cells in both Grid s are the same...
Read more >Create a Virtualized List with Auto Sizing Cells using react ...
In this lesson we'll use CellMeasurer and CellMeasurerCache to automatically calculate and cache the height of a row.
Read more >How to use the react-virtualized/dist/commonjs/CellMeasurer ...
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... columnHeights = {}; this.cache =...
Read more >react-easy-virtualized - npm
Latest version: 0.0.7, last published: 3 months ago. ... CellMeasurer } from 'react-virtualized'; const cache = new CellMeasurerCache(); ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had some performance issue with the CellMeasurer for highly dynamic row height. So i’ve come up with a simple solution(key based caching) that seemed to resolve also this issue.
I wanted to use the CellMeasurer to calculate the dynamic height but only when a similar row hasn’t been computed yet. For example let’s say that each row has 0…n child I could use the child count as my key and still benefits from the CellMeasurer to measure all my item + padding/margin.
If someone is interested here is my implementation:
And thanks for this awesome library!
Yep, we’re using this strategy right now without
CellMeasurer
, just using our own cache and passing heights straight toList
. Having this baked in would be awesome though…