Posted 5 October 2024, 5:40 am EST - Updated 5 October 2024, 5:45 am EST
Hello,
I’m creating a React application using SpreadJS.
With the following simple code, a resizable table was successfully created on a spreadsheet. However, when I tried to resize a table with dragging its handle, an unhandled exception occured in ‘…/node_modules/.vite/deps/@mescius_spread-sheets.js.’ The error message shown up was “TypeError: Cannot read properties of undefined (reading ‘row’)”.
Why? It would be appreacted for any helps to me. Thank you in advance.
import * as GC from '@mescius/spread-sheets';
import '@mescius/spread-sheets/styles/gc.spread.sheets.excel2016black.css';
import * as React from 'react';
import './App.css';
import Sheets = GC.Spread.Sheets;
export default function App() {
const host = React.useRef<HTMLDivElement>();
React.useEffect(
() => {
const workbook = new Sheets.Workbook(host.current, {sheetCount: 3});
const sheet = workbook.getActiveSheet();
const table = sheet.tables.add("table1", 1, 1, 4, 4, Sheets.Tables.TableThemes.light1);
table.showResizeHandle(true);
return () => workbook.destroy();
},
[]
);
return (
<div ref={host} style={{ height: "100%", width: "100%" }} />
);
}
Here is the detail information that Visual Studio provided me regarding the unhandled exception.
Message=
Source=
Stack trace:
at r2 (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:49771:77)
at Y.paintAdornment (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:49779:35)
at Pt.f2.et (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:4110:54)
at i2.jy (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:14942:37)
at n2.jy (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:2046:16)
at i2._e (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:14930:59)
at i2.E1 (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:14919:91)
at In.F1 (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:3744:123)
at i2.p_ (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:12448:53)
at i2.Zg (https://localhost:5173/node_modules/.vite/deps/@mescius_spread-sheets.js?v=e712fa19:12428:36)