handsontable
handsontable copied to clipboard
beforeRemoveRow throws an error while combined with useState
Description
Trying to get the removed row index and store it as a state in React produces the following error:
Uncaught TypeError: Cannot read properties of null (reading 'runHooks') at e.value (handsontable.full.min.js:500:128380) at e.value (handsontable.full.min.js:500:125935) at handsontable.full.min.js:500:21932 at o (handsontable.full.min.js:31:10415) at N (handsontable.full.min.js:500:21780) at Object.alter (handsontable.full.min.js:500:22160) at t.default.alter (handsontable.full.min.js:500:36808) at t.default.callback (handsontable.full.min.js:626:157171) at handsontable.full.min.js:500:195452 at o (handsontable.full.min.js:31:10415)
Steps to reproduce
- Use context menu to remove any row
- Open dev console to see the error
Demo
https://jsfiddle.net/mjt2cfky/
Your environment
- Handsontable version: 12.1
- Browser name and version: Google Chrome 103
- Operating system: macOS Monterey 12.4
Inform forum