[React] dynamically set afterChange

Tags: #<Tag:0x00007efc704d7538> #<Tag:0x00007efc704d73d0>

I’m trying to set afterChange dynamically upon change of some variable.
However, it seems to get updated for the first time but not afterward.

Is there any preferred way to update afterChange dynamically?

How to reproduce:

  1. without changing text, change cell values
    -> prints “afterChange: text is 2 2”
    19%E2%80%AFPM

  2. change text to “3”
    -> prints “afterChange: text is not 2 3”
    30%E2%80%AFPM

  3. change text back to “2”
    -> still prints “afterChange: text is not 2 2”
    when the expected output should be “afterChange: text is 2 2”
    41%E2%80%AFPM

Please refer to samples I tried:

Hi @george1

It seems there are two issues. First one is that you are using very old version of Handsontable, and that adds to the problem. The second one is that it looks like the values entered manually are of different type than initially assigned through useState. When I updated the Handsontable to v. 13.1.0 and don’t check for the type but strictly the value it works correctly: Example

Would that solution work for you?

Hello,

Unfortunately, that was not the issues. I must’ve forked from wrong version. My code bases are actually v13.1.0.
Also I was just simplifying the example to show the issue. I’ll try to create a new example.