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

CellMeasurer: add registerChild render prop #1477

Merged
merged 2 commits into from
Jan 30, 2020

Conversation

Hypnosphi
Copy link
Contributor

@Hypnosphi Hypnosphi commented Dec 31, 2019

Thanks for contributing to react-virtualized!

Before submitting a pull request, please complete the following checklist:

  • The existing test suites (npm test) all pass
  • For any new features or bug fixes, both positive and negative test cases have been added
  • For any new features, documentation has been added
  • For any documentation changes, the text has been proofread and is clear to both experienced users and beginners.
  • Format your code with prettier (yarn run prettier).
  • Run the Flow typechecks (yarn run typecheck).

Motivation

This enables a way to use CellMeasurer without findDOMNode, e.g. in React StrictMode. Here's an example usage:

<CellMeasurer {...}>
  {({registerChild}) => <div ref={registerChild} />}
</CellMeasurer>

@codecov-io
Copy link

Codecov Report

Merging #1477 into master will decrease coverage by 0.03%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1477      +/-   ##
==========================================
- Coverage    94.7%   94.66%   -0.04%     
==========================================
  Files          47       47              
  Lines        1795     1801       +6     
==========================================
+ Hits         1700     1705       +5     
- Misses         95       96       +1
Impacted Files Coverage Δ
source/CellMeasurer/CellMeasurer.js 93.02% <85.71%> (-1.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad85acc...5ac8435. Read the comment docs.

@Hypnosphi
Copy link
Contributor Author

@wuweiweiwu @bvaughn Can you please review? React Concurrent mode gets closer every day =)

@wuweiweiwu wuweiweiwu self-assigned this Jan 30, 2020
Copy link
Collaborator

@wuweiweiwu wuweiweiwu left a comment

Choose a reason for hiding this comment

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

Thank you for this!! Will release as a minor

@wuweiweiwu wuweiweiwu merged commit dc9e2dd into bvaughn:master Jan 30, 2020
@Hypnosphi Hypnosphi deleted the cell-measurer-register-child branch January 30, 2020 21:08
@seanstrom
Copy link
Contributor

@wuweiweiwu when is this change planned to be released?

@fake-car
Copy link

please release to appease

@wuweiweiwu
Copy link
Collaborator

apologize for the super delayed release

https://github.com/bvaughn/react-virtualized/blob/master/CHANGELOG.md#9220

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.

None yet

5 participants