sanity-plugin-table
sanity-plugin-table copied to clipboard
Update TableComponent.tsx to use `deepClone` function over spread.
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.
@rdunk this fixes #14
Thank you so much! I'm yarn patching this until it gets merged 🎉
@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.