diff --git a/src/TableComponent.tsx b/src/TableComponent.tsx index 63d925d..ac99e84 100644 --- a/src/TableComponent.tsx +++ b/src/TableComponent.tsx @@ -56,7 +56,7 @@ const TableComponent: FunctionComponent = (props) => { }; const addRows = (count: number = 1) => { - const newValue = { ...value }; + const newValue = deepClone(value); // Calculate the column count from the first row const columnCount = value.rows[0].cells.length; for (let i = 0; i < count; i++) { @@ -71,7 +71,7 @@ const TableComponent: FunctionComponent = (props) => { }; const addRowAt = (index: number = 0) => { - const newValue = { ...value }; + const newValue = deepClone(value); // Calculate the column count from the first row const columnCount = value.rows[0].cells.length;