Skip to content

Commit

Permalink
use deep clone instead of spread
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisBullinger committed Jul 13, 2022
1 parent 373c7fb commit 0c13a09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TableComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const TableComponent: FunctionComponent<RootProps> = (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++) {
Expand All @@ -71,7 +71,7 @@ const TableComponent: FunctionComponent<RootProps> = (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;

Expand Down

0 comments on commit 0c13a09

Please sign in to comment.