bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.43k stars 3.06k forks source link

use 'registerChild' as ref in registerChild example #1814

Closed pinko-fowle closed 3 months ago

pinko-fowle commented 1 year ago

In the registerChild example in CellMeasurer, we never use registerChild. From looking around some, I believe one valid use is to pass it as ref={registerChild}, which I do here.

I'm still quite unsure of this PR but it seems to match most of the examples I've found. And the current state of the docs seems quite weird/confusing, as we introduce this param then don't use it. I hope this PR makes sense, & please forgive me if not.

One example of another user here following this pattern is this comment: https://github.com/bvaughn/react-virtualized/issues/1572#issuecomment-1155080288