handsontable icon indicating copy to clipboard operation
handsontable copied to clipboard

beforeRemoveRow throws an error while combined with useState

Open adrianszymanski89 opened this issue 2 years ago • 0 comments

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

  1. Use context menu to remove any row
  2. 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

adrianszymanski89 avatar Aug 01 '22 14:08 adrianszymanski89