I am trying to use in ReactJs+webpack environemnt, I have used it as below
Added below command in package.json to install npm package
jquery.contextmenu": "next",
import $ from "jquery";
import contextMenu from "jquery-contextmenu";
class ContextMenuHandler {
constructor() {
$.contextMenu({
// define which elements trigger this menu
selector: ".node",
// define the elements of the menu
items: {
foo: { name: "Foo", callback: function (key, opt) { alert("Foo!"); } },
bar: { name: "Bar", callback: function (key, opt) { alert("Bar!"); } }
}
// there's more, have a look at the demos and docs...
});
}
}
I am getting below error. Do you have suggestions?
ReferenceError: $ is not defined
Hi,
I am trying to use in ReactJs+webpack environemnt, I have used it as below
Added below command in package.json to install npm package
jquery.contextmenu": "next",
import $ from "jquery"; import contextMenu from "jquery-contextmenu";
class ContextMenuHandler {
constructor() {
}
}
I am getting below error. Do you have suggestions? ReferenceError: $ is not defined