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

Rename childRef to registerChild and add some docs #947

Merged
merged 2 commits into from
Jan 5, 2018

Conversation

TrySound
Copy link
Contributor

@TrySound TrySound commented Jan 5, 2018

No description provided.

@TrySound TrySound requested a review from bvaughn January 5, 2018 12:48
@codecov-io
Copy link

codecov-io commented Jan 5, 2018

Codecov Report

Merging #947 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #947   +/-   ##
=======================================
  Coverage   90.37%   90.37%           
=======================================
  Files          57       57           
  Lines        1632     1632           
=======================================
  Hits         1475     1475           
  Misses        157      157
Impacted Files Coverage Δ
source/WindowScroller/WindowScroller.js 98.41% <ø> (ø) ⬆️

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 2a4c52d...c36e1ab. Read the comment docs.

Copy link
Owner

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

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

Thanks buddy

ReactDOM.render(
<WindowScroller>
{({ height, isScrolling, registerChild, scrollTop }) => (
<div ref={registerChild}>
Copy link
Owner

Choose a reason for hiding this comment

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

Is the wrapper div necessary? (Why?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's an example of using registerChild Usually it's more complex layout which requires information from WindowScroller.

Copy link
Owner

Choose a reason for hiding this comment

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

I think the docs should make that clearer then, probably.

The other registerChild props get attached to the List (or Table, whatever) itself. This one could too, right? So if we show otherwise, we should probably add a comment or explanation about why or when you might want to do this.

@@ -53,3 +53,37 @@ ReactDOM.render(
document.getElementById('example')
);
```

or using `registerChild` you can specify grid container deeper in layout (by default `WindowScroller` uses `ReactDOM.findDOMNode` function)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks good?

Copy link
Owner

Choose a reason for hiding this comment

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

Much better! 😄 Thanks!

@TrySound TrySound merged commit 56d55da into master Jan 5, 2018
@TrySound TrySound deleted the window-scroller-register-child branch January 5, 2018 17:15
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.

3 participants