replace JSON.parse(JSON.stringify({})) with structuredClone({})

This commit is contained in:
Amruth Pillai
2024-05-10 11:00:15 +02:00
parent c1a58118c2
commit a102f62e28
8 changed files with 12 additions and 15 deletions

View File

@ -34,7 +34,7 @@ export const moveItemInLayout = (
): string[][][] => {
try {
// Create a deep copy of the layout to avoid mutating the original array
const newLayout = JSON.parse(JSON.stringify(layout)) as string[][][];
const newLayout = structuredClone(layout);
// Get the item from the current location
const item = newLayout[current.page][current.column][current.section];