React Validator + Comment

Hi there!

In a React HOT component I would like to add an error comment on invalid inputs.
I have a columnFeatures array of objects, some of which have a validator:

          if (/\d{8}/.test(value) || value == '') {
            callback(true)
          } else {
            callback(false)
          }
        },```

The validator works fine on its own. Now through the afterValidate hook I'd like to add a comment similar to here https://handsontable.com/blog/articles/2017/12/guide-to-basic-data-validation

My questions:
How do I use colToProp in React?
How can I use the comments plugin in React?

Right now I'm looping over the columns to get the index by the col name the afterValidate function is giving me. Maybe there is another option then colToProp that I'm overlooking?

Thanks so much!
Lisa

Aaaand I just took a closer look at this: react-setstate-issue-with-aftervalidate/3049 which will probably answer a lot already. My comment plugin question still stands, though. :slight_smile:

Good day,

what you would like to do exactly? Settings up a comment doesn’t differ from the vanilla version. Here Comments - JavaScript Data Grid | Handsontable are some examples.

When you want be to notified about a new comment you can listen to afterSetCellMeta hook.

Here’s what you get


The first element is the row index no, here it’s 4, then the index of a column, here’s 2.
The 3rd element tells us that the cell meta change is a comment. The last one stands for the comment text that has been added.