I'm trying to use Blotter.js in my React application, but I can't find out how to define the Blotter class in my React application.
I exported this codepen that tests Blotter.js (https://codepen.io/jgordon-orange/pen/oEGxpp) and it works locally as it's not a React application. However, trying to add the script tags in the head of my Index.HTML has not worked. I also tried importing all of the scripts with React, but that didn't work either. Importing the package from NPM didn't work, probably because it hasn't been updated in 3 years.
componentDidMount() {
const links = ["https://cdn.rawgit.com/bradley/Blotter/3007fe6e/build/blotter.min.js", "https://cdn.rawgit.com/bradley/Blotter/3007fe6e/build/materials/channelSplitMaterial.js", "https://cdn.rawgit.com/bradley/Blotter/3007fe6e/build/materials/fliesMaterial.js"]
for (var i=0; i<links.length; i++){
const script = document.createElement("script");
script.src = links[i];
script.async = true;
document.body.appendChild(script);
}
}
When I try to run the code with my methods of importing the libraries, I'm expecting that the code will work as in the demo I linked, but instead I'm getting this error: TypeError: blotter__WEBPACK_IMPORTED_MODULE_13__.default.Text is not a constructor, or I'm getting Blotter is not defined.