0

I want to use jquery.scrollbar plugin in my react application. I want the jquery.scrollbar for every component which is scrollable. I have already installed it via npm. I am not getting any way to initialize it in my react component. How should I do it?

2
  • Do you have code you can share here so we can see what you have so far? You will need to create a component and initialize the scrollbar there, likely in componentDidMount. Commented Jul 10, 2017 at 19:51
  • I can't recommend using jQuery libraries inside of react apps. It's a common source of trouble because they are interfering when updating the DOM. Try to avoid jQuery at all. There should already be solutions for this provided as react components. Commented Jul 10, 2017 at 21:40

1 Answer 1

2

Always remember to import it in your components and called the function inside your JSX. I believe react js has some nice scrollbar which are more suitable

http://malte-wessel.github.io/react-custom-scrollbars/

Sign up to request clarification or add additional context in comments.

3 Comments

When I use this, browser's scrollbar is also coming and I can see both custom as well as default scrollbar. How to deal with this?
good, and you can use react-nice-scroll it is so easy to use, and here is the link npmjs.com/package/react-nice-scrollbar
@ApurvG I think I got what you meant. If you wanna remove browser scrollbar. You need to do css style changes to the container thats holding this scrolling area. try set style="overflow-y: hidden"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.