I try to use mxgraph with react project. But I can not use mxgraph with react.
I install mxgraph:
npm install mxgraph
Then I wrote:
import {
mxGraph,
mxGraphHandler,
mxGraphModel,
...
} from "mxgraph";
InitGraph =()={
let container = document.createElement("div");
this.setContainerStyle();
let model = new mxGraphModel();
let graph = new mxGraph(container,model);
}
I got an error --> Uncaught TypeError: mxGraphModel is not a constructor.
But when I use to mxgraph-js it is correctly working.
How I use mxgraph ?