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

add context support #28

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hhhonzik
Copy link

I am using react-gemini-scrollbar library in my project and i find it very helpful.

But today I was adding react-scroll library which needs a containerId - which can be obtained with scrollbar.getViewElement().

I added context support to the component, so now you can get the instance like this:

class Button extends React.Component {
  static contextTypes = {
    geminiScrollbar: React.PropTypes.object
  };

  onClick() {
    console.log(this.context.geminiScrollbar.get().getViewElement);
  }

I also refactored the component as Class while doing that.

@JakubKontra
Copy link

+1

@milan182
Copy link

milan182 commented Oct 6, 2016

+1

This will really helpful - We need to add our own scroll event listener on the scrollbar.getViewElement() to implement a infinite scroll feature.

@neolectron
Copy link

up ? :)

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

Successfully merging this pull request may close these issues.

4 participants