I'm trying to implement the examples in https://www.cornerstonejs.org/docs/examples#run-examples-locally in a react app but I'm not sure what to do.
What I did:
- npx create-react-app my-app --template typescript
- npm install
- npm install @cornerstonejs/core @cornerstonejs/tools @cornerstonejs/streaming-image-volume-loader
- moved the util and packages from corerstone3d.beta folders into the project src folder
- Imported the libraries via the code on the bottom of this page
- Copied some of the html into the App() { return (.......); }
- Copied some of the code from here:" https://www.cornerstonejs.org/live-examples/stackbasic " (check console for source code) into App.tsx
- Fixed some of the errors via importing missing libraries
I get however thousands of errors from the functions in util and packages folders that i took from cornerstone3d as seen in the next picture:

import React from 'react';
import logo from './logo.svg';
import './App.css';
import { RenderingEngine, Types, Enums } from '@cornerstonejs/core';
import {
initDemo,
createImageIdsAndCacheMetaData,
setTitleAndDescription,
ctVoiRange,
} from './utils/demo/helpers';
function App() {
const { ViewportType } = Enums;
// ======== Set up page ======== //
setTitleAndDescription(
'Basic Stack',
'Displays a single DICOM image in a Stack viewport.'
);
const content = document.getElementById('content');
const element = document.createElement('div');
element.id = 'cornerstone-element';
element.style.width = '500px';
element.style.height = '500px';
// ============================= //
return (
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta
name="viewport"
content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<script defer src="stackBasic.js"></script></head>
<body>
Style the title and description components so they are the same in every demo
<div id="demo-title-container">
<h1 id="demo-title">
Insert demo title here during demo
</h1>
</div>
<div id="demo-description-container">
<p id="demo-description">
Insert demo title here during demo
</p>
</div>
<div id="demo-toolbar">
Insert buttons/dropdowns/etc here during demo
</div>
<div id="content"></div>
</body>
</html>
);
}
export default App;
(the code is missing some parts as im trying to fix the import first)
If any solutions on other frameworks exist I would also like to have a look at them
you need to download cornerstone3d at cornerstone3d again and then install all node packages with npm install