[GH #9719] Getting ERROR when i use setState(method of useState hook) inside beforeRemoveRow handsontable hook

Tags: #<Tag:0x00007f8b24127c38>

Hi,

I am getting a script error when i am trying to use setState method of useState react hook inside the beforeRemoveRow hook of handsontable.

Demo-https://jsfiddle.net/mjt2cfky/

when i right click on a row and try to remove a row from context menu i am getting a script error

Hi @sumit.baudh

Can you please tell what is your expected output here except of deleting the row?

I just wanted to set the deleted row index to my react state, nothing much.

Hi @adrian.szymanski could you please share your finding on this?

Hi @sumit.baudh

Ok, that’s what I thought but I wanted to be sure. I tried to find what’s exactly wrong in that implementation, but everything looks just fine. I also tried to set the state in afterRemoveRow hook and then it allows you to delete the row but still doesn’t keep the deleted row index in the state. I’m afraid it’s some kind of incompatibility within Handsontable while using React states as it occurs in some of the plugins.

We are currently working on improving the experience of using the Handsontable with React so I hope that issue will be solved in the nearest future.

Thanks @adrian.szymanski , Could you please create a github issue for the same.

Hi @sumit.baudh

Sorry for the late response. I didn’t get your last message. I created the issue on GitHub, you can track it here:

I’ll also inform you when it will be fixed.