I have a copy of the sheetjs.js file and I would like to use it in my React TypeScript app.
I have entered a reference to the sheetjs in the HTML file found in public folder.
<script src="%PUBLIC_URL%/sheetjs.js"></script>
I have copied the file inside the public folder of the React application.
If I do the following:
React.useEffect(() => {
let wb = new WorkBook();
}, []);
It throws this error:
Cannot find name 'WorkBook'.
How can I access sheetjs and its objects in component?
Tried this:
const xlsx= XLSX.utils;
As stated in their documentation: const worksheet = XLSX.utils.json_to_sheet(rows);
It returns: Cannot find name 'XLSX'.
In the console it returns the following: