React-router : How to trigger $(document).ready()?
<p>In my current React + React-router setup my component imports some jQuery things (owl.carousel and magnific popup)</p>

<p>I want to keep the code clean, so the external features are stored in separate file. The code below works only when the page is loaded with direct URL and doesn't work when navigating back and forwards the app. So everything inside <code>$(document).ready</code> is triggered only with direct link.</p>

<pre><code>import '../jQuery/carousel.js';

$(document).ready(function(){
    $('.owl-carousel').owlCarousel({
    });

    $('.popup-gallery').magnificPopup({
    });
});
</code></pre>

<p>How do I manage this problem? I tried to use componentWillMount and wrap .ready()  with some custom function, but I can't access <code>updateJs()</code> in imported file</p>

<pre><code>class MyComponent extends Component {
  componentWillMount() {
    updateJs();
  }
}
</code></pre>