reactScrollbar icon indicating copy to clipboard operation
reactScrollbar copied to clipboard

Use the context in a onScroll function

Open AlexDemzz opened this issue 7 years ago • 1 comments

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 ?

AlexDemzz avatar Jun 05 '18 19:06 AlexDemzz

i had the same problem, it resolve like this: add the follow content: yourComponent.contextTypes = { scrollArea: React.PropTypes.object };

snafm avatar Aug 21 '19 03:08 snafm