Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TableComponent.tsx to use deepClone function over spread. #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bendesilva
Copy link

@bendesilva bendesilva commented Feb 25, 2022

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.

…ad syntax

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 an 'can't define property "x": "obj" 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, which resulted in the error.
@MathisBullinger
Copy link

@rdunk this fixes #14

@mckelveygreg
Copy link

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

@MathisBullinger
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants