title: Initializing PerfectScrollbar in React app
body: <p>I was using the old version of <code>perfect-scrollbar</code> in my <code>React</code> app. In the old version, there was an <code>ps.initialize()</code> method that I was using with a <code>ref</code> to the section that I wanted to use perfect scrollbar for.</p>
  
  <p>I tried the new approach -- see below -- but perfect scrollbar doesn't seem to be initializing.</p>
  
  <pre><code>import PerfectScrollbar from 'perfect-scrollbar';
  
  class MyComponent extends Component {
  
     componentDidMount() {
  
        const sb1 = new PerfectScrollbar(this.refs.ref1);
        const sb2 = new PerfectScrollbar(this.refs.ref2);
        sb1.update();
        sb2.update();
     }
  
     render() {
        return(
             &lt;div ref="ref1"&gt;
                  Section 1
             &lt;/div&gt;
             &lt;div ref="ref2"&gt;
                  Section 2
             &lt;/div&gt;
        );
     }
  }
  
  export default MyComponent;
  </code></pre>
  
  <p>What's the right way to use perfect scrollbar in a <code>React</code> app? BTW, there's a <a href="https://github.com/goldenyz/react-perfect-scrollbar" rel="nofollow noreferrer">React Wrapper</a> for perfect scrollbar but it hasn't been updated for a while and this newly updated version of <code>perfect-scrollbar</code> has addressed some of the issues of the old one so I'd really like to use this one. I'd appreciate some pointers here. Thanks.</p>