reactScrollbar
reactScrollbar copied to clipboard
Use the context in a onScroll function
Hey guys, i have a problem.
I have this :
<ScrollArea speed={0.5} className="scroll-container" contentClassName="container" smoothScrolling={true} horizontal={false} onScroll={(value) => this.handleScrollWheel(value)} >
And I want to do something like :
handleScrollWheel = (value) => { this.context.scrollArea.scrollTop(); }
but for now, the context is undefined, do you have any solutions ?
i had the same problem, it resolve like this: add the follow content: yourComponent.contextTypes = { scrollArea: React.PropTypes.object };