React setState issue with validation

Tags: #<Tag:0x00007f8b1d63a790>

Hi @aleksandra_budnik & @dag,

I go through your demo regarding earlier conversation but validation is not working on first change of value.

Hey @preet.saxena

can you tell me something about your application? Do you verify data after it gets loaded or only after user change? What changes are made: edit, copy/paste, undo/redo, autofill?

The change can be of any type issue is with the setstate when I trigger my HoT’s parent component state the validation from the HoT are going to be remove

OK. I will check it out and be back as soon as I get anything.

Hey @preet.saxena

I got a fixed demo https://codepen.io/handsoncode/pen/WmMrgb

Hi @aleksandra_budnik,

Why we are handling invalid cell manually after change in state ? it will lead to a performance issue, is there something wrong with internal state of handsontable ?

I’ve asked the developer who helped with the example and he told me that afterValidate called setState which then called render (you got a loop). It is the way Handsontable works.

Thanks @aleksandra_budnik,

So I think we are limited to use the full utilization of Handsontable with react state ?

Yes, and it won’t change in the nearest future (I do not see any related topic on our Roadmap).

Thanks, @aleksandra_budnik