Get the same problem developing my react app. So I have import JQuery using such a command
npm install jquery
Late I download a js min file from the site,
You can find it at the top. It named jquery.loupe.min.js. So I copied it, and create my own js file in the src folder.
In my header i include all thees files:
import $ from 'jquery';
import './jquery.loupe.min.js'
And in my function, i try to call loop:
if (this.props.activeItem === "Loop") {
$('graph').loupe();
//window.$ = window.jQuery = require('jquery')
//window.$('graph').loupe();
}
I think that the second and third lines should work, but it gets the same result. No errors, but nothing. My console.log of window$
content.js?5f7c:406 ƒ ( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery…
So in my render method, I have a canvas that I want to connect with loop:
<div className="canvas">
<canvas
id="graph"
className="canvas-actual"
width="800px"
height="480px"
ref={this.canvasRef}
onMouseDown={this.handleMouseDown}
onMouseMove={this.handleMouseMove}
onMouseUp={this.handleMouseUp}
>
</canvas>
Nothing happed. No errors, or warnings. I have no ideas that matter. Thanks. Code (need python2)