react-gemini-scrollbar
react-gemini-scrollbar copied to clipboard
add context support
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.
+1
+1
This will really helpful - We need to add our own scroll event listener on the scrollbar.getViewElement()
to implement a infinite scroll feature.
up ? :)