-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #947 +/- ##
=======================================
Coverage 90.37% 90.37%
=======================================
Files 57 57
Lines 1632 1632
=======================================
Hits 1475 1475
Misses 157 157
Continue to review full report at Codecov.
|
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.
Thanks buddy
docs/WindowScroller.md
Outdated
ReactDOM.render( | ||
<WindowScroller> | ||
{({ height, isScrolling, registerChild, scrollTop }) => ( | ||
<div ref={registerChild}> |
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.
Is the wrapper div necessary? (Why?)
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.
It's an example of using registerChild
Usually it's more complex layout which requires information from WindowScroller.
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 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) |
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.
Looks good?
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.
Much better! 😄 Thanks!
No description provided.