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

beforeRemoveRow throws an error while combined with useState #9719

Open
adrianszymanski89 opened this issue Aug 1, 2022 · 1 comment
Open
Labels
bug React Issues regarding the @handsontable/react wrapper. Reported

Comments

@adrianszymanski89
Copy link
Contributor

adrianszymanski89 commented Aug 1, 2022

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 adrianszymanski89 added bug React Issues regarding the @handsontable/react wrapper. labels Aug 1, 2022
@AMBudnik
Copy link
Contributor

It works the same for the afterRemoveRow() hook. Tested with React 17 and 18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug React Issues regarding the @handsontable/react wrapper. Reported
Projects
None yet
Development

No branches or pull requests

2 participants