I would like to add some javascript libraries to my reactJS project.
I do this by adding script tags to the section of index.html
<script src="../src/components/reports/scripts/stimulsoft.reports.js"></script>
<script src="../src/components/reports/scripts/stimulsoft.viewer.js"></script>
and usage of library is like:
class Viewer extends React.Component {
render() {
return <div id="viewerContent"></div>;
}
componentWillMount() {
var report = Stimulsoft.Report.StiReport.createNewReport();
report.loadFile("reports/Report.mrt");
var options = new Stimulsoft.Viewer.StiViewerOptions();
this.viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
this.viewer.report = report;
}
componentDidMount() {
this.viewer.renderHtml("viewerContent");
}
}
these are original sample Stimulsoft Reports.JS and GitHub

componentWillMountfor all practical purposes has been deprecated, have you tried usingcomponentDidMountfully instead? I suspect you are calling that code and it may not be fully loaded yet... just guessing at this point though.windowdoesnot have aSimulsoftobject attached. May be because theSimulsoftJS files are not accessible/invoked fromindex.htmlwhich is available inpublicfolder.srcdirectory.componentDidmountcycle as suggested by @DrewReese, is to make sure that the paths to the stimulsoft scripts are correct, and check that they are loaded, can you share the complete html?