sanity-plugin-table icon indicating copy to clipboard operation
sanity-plugin-table copied to clipboard

Update TableComponent.tsx to use `deepClone` function over spread.

Open bendesilva opened this issue 3 years ago • 3 comments

When using the table within a block editor, having created a table, left the document and returned, adding a new row/s would result in a Cannot add property x, object is not extensible error in the console.

Both the addRows and addRowAt functions were using spread syntax when assigning the newValue const, rather than using the deepClone function which is used by all other functions, resulting in the error.

Switching to the deepClone function has resolved this issue.

bendesilva avatar Feb 25 '22 10:02 bendesilva

@rdunk this fixes #14

MathisBullinger avatar Jul 13 '22 08:07 MathisBullinger

Thank you so much! I'm yarn patching this until it gets merged 🎉

mckelveygreg avatar Sep 14 '22 04:09 mckelveygreg

@mckelveygreg I made a fork that fixes this and some other issues that I'm maintaining for a work project.

Should this repo become active again, I'd be more than happy to contribute any patches and updates here instead of maintaining a fork.

MathisBullinger avatar Sep 14 '22 09:09 MathisBullinger