Skip to content

Commit

Permalink
Fix generate js
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanblinov2k17 committed Nov 9, 2023
1 parent c4a2205 commit 082e111
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions JSDemos/Demos/Diagram/CustomShapesWithIcons/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import 'whatwg-fetch';
export default function App() {
const diagramRef = React.useRef(null);
React.useEffect(() => {
let _a;
const diagram = (_a = diagramRef.current) === null || _a === void 0 ? void 0 : _a.instance;
const diagram = diagramRef.current?.instance;
fetch('../../../../data/diagram-hardware.json')
.then((response) => response.json())
.then((json) => {
diagram === null || diagram === void 0 ? void 0 : diagram.import(JSON.stringify(json));
diagram?.import(JSON.stringify(json));
})
.catch(() => {
throw new Error('Data Loading Error');
Expand Down

0 comments on commit 082e111

Please sign in to comment.