react-gemini-scrollbar icon indicating copy to clipboard operation
react-gemini-scrollbar copied to clipboard

add context support

Open hhhonzik opened this issue 7 years ago • 3 comments

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.

hhhonzik avatar Aug 10 '16 13:08 hhhonzik

+1

JakubKontra avatar Aug 10 '16 14:08 JakubKontra

+1

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

milan182 avatar Oct 06 '16 14:10 milan182

up ? :)

neolectron avatar Aug 06 '17 16:08 neolectron