Manually update table data in react hook

Tags: #<Tag:0x00007f3439152a38>

Hello, i am using handsontable-react with react functional component.
I am using react’s useState hook to keep table’s data like this

const [data, setData] = useState([[]])

After i manually updated state by using setData(newData) (for adding new columns/rows), the table’s data is updated but then all cells become uneditable.
They keep showing me this error when i try to edit value of a cell
Cannot assign to read only property of object '[object Array]'

I has been searching on google how to using handsontable with react but all examples are using react class based component.

Thanks

Hi @cyborg31596

Thank you for reporting the ticket. I will investigate the case and come back to you after the weekend.

1 Like

Thank you for your patience @cyborg31596 I wanted to confirm the investigation results with my colleague. And without the information that is within the newData, we won’t be able to diagnose the reason for the error. Could you prepare a demo or use this one https://handsontable.com/docs/9.0.0/frameworks-wrapper-for-react-simple-examples.html with your settings?

Hi @aleksandra_budnik
I have already figured out where is the problem and fix it. And it came from another 3rd-party library which is not related to handsontable.
Thank you for your support !

Thank you for the feedback, @cyborg31596