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

Use the context in a onScroll function #122

Open
AlexDemzz opened this issue Jun 5, 2018 · 1 comment
Open

Use the context in a onScroll function #122

AlexDemzz opened this issue Jun 5, 2018 · 1 comment

Comments

@AlexDemzz
Copy link

AlexDemzz commented Jun 5, 2018

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 ?

@snafm
Copy link

snafm commented Aug 21, 2019

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

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

No branches or pull requests

2 participants