Created
August 23, 2016 01:17
-
-
Save AsaAyers/b2ade4a49b2277e0d7b2346c27229ba5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This was written using gists editor. I hope I have the syntax right. | |
function HOCAutoSizer(ChildComponent) { | |
return function(props) { // Stateless component | |
return ( | |
<AutoSizer> | |
{({ height, width }) => ( | |
<ChildComponent | |
width={width} | |
height={height} | |
{...props} | |
/> | |
)} | |
</AutoSizer> | |
) | |
} | |
} | |
const SizedScroll = HOCAutoSizer(VirtualScroll) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment