srinivas srinivas -4 years ago 279
React JSX Question

offcanvas jquery trigger not working in React

I have included jasny's bootstrap offcanvas menu in a react app.
While I can trigger and hide the open menu through console in jasny's example like so:


But doing the same in my react app is throwing error: Uncaught TypeError: $(...).offcanvas is not a function(…)

I am guessing its got something to do with javascript closure. Is there any other way to trigger this?

Answer Source

I ended up having to trigger like this on my page load:

      if(window.innerWidth > 1000)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download